Closed shineli1984 closed 6 years ago
See also: https://github.com/fantasyland/fantasy-land/issues/169, https://github.com/fantasyland/fantasy-land/issues/181, https://github.com/fantasyland/fantasy-land/issues/228, https://github.com/fantasyland/fantasy-land/issues/242, and https://github.com/fantasyland/fantasy-land/issues/283.
How ptotoype.ap
is implemented is up to library authors. Most of the time, it will be as ap :: Apply f => f (a -> b) ~> f a -> f b
, because it favours readability when fluent-method chaining.
Fantasy land doesn't specify prototype.ap
. It specifies prototype['fantasy-land/ap']
, and that one is the other way around.
It was changed for reasons of consistency when Fantasy Land 1.0 was released. The fantasy-* repos were never updated to adopt the new prefixed method specifications.
Thanks for the explaination.
I had a look at a few fantasy-* repos where
ap
method is derived as belowIn the current ap type signature
ap :: Apply f => f a ~> f (a -> b) -> f b
, my understanding is thatf a
refers tothis
in the above method.So I'm wondering if the type signature for
ap
should be:?