-
Notifications
You must be signed in to change notification settings - Fork 25
Option.of is non-parametric #146
Comments
@puffnfresh the static In the actual Applicative instance (for both Fantasy Land and static-land) The naming "of" might be unfortunate, but it is very popular in the JS ecosystem and the protocol for FL is describing it with a prefix and the FL spec is respected. Do you think that's not ok? |
I would argue that there's no precedent for this particular behaviour in the "JS ecosystem" and that Fantasy Land specifically sets a precedent that |
@puffnfresh I was under the impression that the naming matters only in the context of the FL protocol. For a user familiar with the FL naming however, I'm sure it is annoying. So I agree with you. Alignment with the naming in FL has been on my mind. As you can see, I preferred flatMap to chain or tailRecM to chainRec among others. Not a very fortunate choice I now realize. So I would like to change the naming. Unfortunately right now I'm busy with my Scala projects, but hopefully I'll get to it. If in the meantime if somebody wants to send a PR, just as a note, Option is not the only one with an "of" that's not the Applicative constructor, so the change needs to be across the board. @puffnfresh thanks for opening the issue. In the meantime if you're in need, use |
Thanks @alexandru |
You can't pass
null
orundefined
toOption.of
. This is super surprising, incompatible with Fantasy Land and breaks the monad and applicative laws.The text was updated successfully, but these errors were encountered: