Permalink
Browse files

(fix fl) Fixes currying and argument order issues

  • Loading branch information...
robotlolita committed Oct 16, 2016
1 parent d761107 commit d5b0c7436717db442d3412b520e33339d9ad4002
@@ -49,7 +49,7 @@ const apply = (applicativeFunction, applicativeValue) =>
* (F (a) => b) => (F a) => F b
* where F is Apply
*/
apply.curried = curry(apply);
apply.curried = curry(2, apply);
/*~
@@ -31,7 +31,7 @@ const isOld = (a) => typeof a.bimap === 'function';
* (F a b, (a) => c, (b) => d) => F c d
* where F is Bifunctor
*/
const bimap = (transformLeft, transformRight, bifunctor) =>
const bimap = (bifunctor, transformLeft, transformRight) =>
isNew(bifunctor) ? bifunctor[flBimap](transformLeft, transformRight)
: isOld(bifunctor) ? warn(bifunctor.bimap(transformLeft, transformRight))
: /*otherwise*/ unsupported(bifunctor);
@@ -51,7 +51,7 @@ const bimap = (transformLeft, transformRight, bifunctor) =>
* ((a) => c) => ((b) => d) => (F a b) => F c d
* where F is Bifunctor
*/
bimap.curried = curry((transformLeft, transformRight, bifunctor) =>
bimap.curried = curry(3, (transformLeft, transformRight, bifunctor) =>
bimap(bifunctor, transformLeft, transformRight)
);
@@ -50,7 +50,7 @@ const chain = (monad, transformation) =>
* ((a) => C b) => (C a) => C b
* where C is Chain
*/
chain.curried = curry((transformation, monad) =>
chain.curried = curry(2, (transformation, monad) =>
chain(monad, transformation)
);
@@ -50,7 +50,7 @@ const concat = (semigroupLeft, semigroupRight) =>
* (S a) => (S a) => S a
* where S is Semigroup
*/
concat.curried = curry((semigroupRight, semigroupLeft) =>
concat.curried = curry(2, (semigroupRight, semigroupLeft) =>
concat(semigroupLeft, semigroupRight)
);
@@ -55,7 +55,7 @@ const empty = (monoid) =>
* (M) => M a
* where M is Monoid
*/
empty.curried = curry(empty);
empty.curried = curry(1, empty);
/*~
@@ -51,7 +51,7 @@ const equals = (setoidLeft, setoidRight) =>
* (S a) => (S a) => Boolean
* where S is Setoid
*/
equals.curried = curry((setoidRight, setoidLeft) =>
equals.curried = curry(2, (setoidRight, setoidLeft) =>
equals(setoidLeft, setoidRight)
);
@@ -50,7 +50,7 @@ const map = (functor, transformation) =>
* ((a) => b) => (F a) => F b
* where F is Functor
*/
map.curried = curry((transformation, functor) =>
map.curried = curry(2, (transformation, functor) =>
map(functor, transformation)
);
@@ -55,7 +55,7 @@ const of = (applicative, value) =>
* (F) => (a) => F a
* where F is Applicative
*/
of.curried = curry(of);
of.curried = curry(2, of);
/*~

0 comments on commit d5b0c74

Please sign in to comment.