Functional-Light-JS icon indicating copy to clipboard operation
Functional-Light-JS copied to clipboard

ch4 composition: add not about composition being "associative"

Open getify opened this issue 6 years ago • 1 comments

compose(compose(fn3,fn2),fn1) ~=~ compose(fn3,compose(fn2,fn1))

getify avatar May 02 '19 17:05 getify

As I know... Sets are types for programmer. If I write a function that given the same type of input(e.g. 1, 2, 3) and returns different type of output(e.g. 'a', 5, True), that will not be a set function which makes composition failed. Since composition is failed, it's no need to check if the composition being associative. If the function is just evaluate(mapping) from one type to another type(maybe the same). It will be a set function. Set functions's composition is always associative in category of set(Sets). If I'm wrong just let me know. Have a good day.

godhand4826 avatar Jun 12 '19 01:06 godhand4826