paldepind / flyd

The minimalistic but powerful, modular, functional reactive programming library in JavaScript.
MIT License
1.56k stars 85 forks source link

fantasyland/ap works backwards #157

Closed schtauffen closed 6 years ago

schtauffen commented 7 years ago

By spec shouldn't a.ap(b) be b.val(a.val) ?

A value which has an Apply must provide an ap method. The ap method takes one argument:

a.ap(b) b must be an Apply of a function

If b does not represent a function, the behaviour of ap is unspecified. b must be same Apply as a. a must be an Apply of any value

ap must apply the function in Apply b to the value in Apply a

No parts of return value of that function should be checked. The Apply returned by ap must be the same as a and b

nordfjord commented 6 years ago

166 should handle this.

The thing is the argument order is correct for fantasy-land v1. But the argument order changed in a later version of the spec.

Now you can have F.ap do whatever you want but F['fantasy-land/ap'] must follow the spec.

paldepind commented 6 years ago

This is fixed now. Previously Flyd implemented the old Fantasy Land ap argument order.