Closed alper closed 1 year ago
In Functor there's:
const f = x => x + 1 const g = x => x * 2 some(1).map(x => g(f(x))) // = some(3) some(1).map(f).map(g) // = some(3)
Especially the second but maybe both should by any reasonable intuition be 4?
4
Take some(1), map it through f, result 2, map it through g, result 4.
some(1)
f
2
g
If for some reason this is different than reading order, then I would say that that reason is wrong.
Also I can't try this out because there's no REPL anywhere?
@alper: You're right. The example is wrong. Care to create a PR to fix it?
Done in #240.
In Functor there's:
Especially the second but maybe both should by any reasonable intuition be
4
?Take
some(1)
, map it throughf
, result2
, map it throughg
, result4
.If for some reason this is different than reading order, then I would say that that reason is wrong.
Also I can't try this out because there's no REPL anywhere?