fantasyland / static-land

Specification for common algebraic structures in JavaScript based on Fantasy Land
MIT License
772 stars 41 forks source link

Static Land vs FL args order #39

Closed rickmed closed 7 years ago

rickmed commented 7 years ago

eg, apply. Does it needs to be updated? Does static-land and FL aims to share args order?

rpominov commented 7 years ago

The order difference is by design. It's optimized for currying. It's very consistent though, basically FL's target value (on which the method is called) goes to the last position in SL's arguments.

a.map(f)
T.map(f, a)

a.ap(f)
T.ap(f, a)

a.chain(f)
T.chain(f, a)
rickmed commented 7 years ago

@rpominov Obviously! I got confused for a moment -sorry for the noise.

rpominov commented 7 years ago

No problem 🙂