Giter VIP home page Giter VIP logo

Comments (6)

Avaq avatar Avaq commented on June 15, 2024

I think you might be reading an outdated version of the Fantasy Land spec. Since version 1.0, Fantasy Land has required compliant methods to be prefixed:

v['fantasy-land/ap'](u['fantasy-land/ap'](a['fantasy-land/map'](f => g => x => f(g(x))))) is equivalent to v['fantasy-land/ap'](u)['fantasy-land/ap'](a)
-- https://github.com/fantasyland/fantasy-land#apply

You'll find that v['fantasy-land/ap'] will behave as expected.

from fluture.

Ne4to777 avatar Ne4to777 commented on June 15, 2024

Does the ap method not meet the requirements of fantasy-land? If so what specification is it using?

from fluture.

Avaq avatar Avaq commented on June 15, 2024

The fantasy-land/ap method follows the specification. The ap function is a polymorphic dispatcher which dispatches to fantasy-land/ap. There is no specification for dispatchers. Library authors are free to implement them as they see fit.

from fluture.

Ne4to777 avatar Ne4to777 commented on June 15, 2024

As I understand ap fallbacks to fantasy-land/ap only if context is not Future, right?

from fluture.

Avaq avatar Avaq commented on June 15, 2024

That's an optimization for performance and debugging reasons made within the Fluture code. It does not alter the behaviour of ap compared to what it would be as a plain dispatcher to m['fantasy-land/ap'].

from fluture.

Avaq avatar Avaq commented on June 15, 2024

In other words, the following code can be removed:

Fluture/src/ap.js

Lines 9 to 15 in 9e8084e

if(isFuture(mx)){
var context1 = application1(ap, future, arguments);
return function ap(mf){
var context2 = application(2, ap, future, arguments, context1);
return mf._transform(new ApTransformation(context2, mx));
};
}

...And all unit tests except the ones related to error messages and debugging will still pass.

from fluture.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.