Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add applyTo to all Apply ADTs #209

Open
13 tasks
evilsoft opened this issue Feb 13, 2018 · 1 comment
Open
13 tasks

Add applyTo to all Apply ADTs #209

evilsoft opened this issue Feb 13, 2018 · 1 comment

Comments

@evilsoft
Copy link
Owner

This is the first step in 馃挴 fantasy-land integration of ap. Will define applyTo on all Apply types which will match the fantasy-land signature. This will be the method that will eventually map to fantasy-land/ap.
In order to handle proper error reporting, method will be need to take in the method name as context:

// applyTo :: Apply m => m a ~> m a -> m (a -> b) -> m b
const applyTo = name => m => (...)

This will be provided for the following types:

  • Async
  • Const
  • Either
  • IO
  • Identity
  • List
  • Maybe
  • Pair
  • Reader
  • Result
  • State
  • Unit
  • Writer

Initially we will not provide a point free function for this method as there is a combinator named applyTo that is used for applying a value to functions...We will need to do a breaking change and some function name juggling:

  • mv combinators/applyTo -> combinators/applyWith
  • mv combinators/reverseApply -> pointfree/applyTo
  • Update pointfree/applyTo to take either (value, function) OR (m value, m function) where m is an Apply of the same type. It should error unless those pairs are exactly met.
@pfgray
Copy link

pfgray commented Sep 19, 2018

Hey, mind if I take a stab at this one? I've created a branch & impl'd a first cut at Async's applyTo here.

I've tested it out with other applicatives and it works swimmingly.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants