Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion bower.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,6 @@
"package.json"
],
"dependencies": {
"purescript-prelude": "^1.0.0"
"purescript-prelude": "^2.1.0"
}
}
12 changes: 0 additions & 12 deletions src/Data/Function/Uncurried.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,6 @@ exports.mkFn0 = function (fn) {
};
};

exports.mkFn1 = function (fn) {
return function (a) {
return fn(a);
};
};

exports.mkFn2 = function (fn) {
/* jshint maxparams: 2 */
return function (a, b) {
Expand Down Expand Up @@ -81,12 +75,6 @@ exports.runFn0 = function (fn) {
return fn();
};

exports.runFn1 = function (fn) {
return function (a) {
return fn(a);
};
};

exports.runFn2 = function (fn) {
return function (a) {
return function (b) {
Expand Down
8 changes: 5 additions & 3 deletions src/Data/Function/Uncurried.purs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import Data.Unit (Unit)
foreign import data Fn0 :: * -> *

-- | A function of one argument
foreign import data Fn1 :: * -> * -> *
type Fn1 a b = a -> b

-- | A function of two arguments
foreign import data Fn2 :: * -> * -> * -> *
Expand Down Expand Up @@ -39,7 +39,8 @@ foreign import data Fn10 :: * -> * -> * -> * -> * -> * -> * -> * -> * -> * -> *
foreign import mkFn0 :: forall a. (Unit -> a) -> Fn0 a

-- | Create a function of one argument
foreign import mkFn1 :: forall a b. (a -> b) -> Fn1 a b
mkFn1 :: forall a b. (a -> b) -> Fn1 a b
mkFn1 f = f

-- | Create a function of two arguments from a curried function
foreign import mkFn2 :: forall a b c. (a -> b -> c) -> Fn2 a b c
Expand Down Expand Up @@ -72,7 +73,8 @@ foreign import mkFn10 :: forall a b c d e f g h i j k. (a -> b -> c -> d -> e ->
foreign import runFn0 :: forall a. Fn0 a -> a

-- | Apply a function of one argument
foreign import runFn1 :: forall a b. Fn1 a b -> a -> b
runFn1 :: forall a b. Fn1 a b -> a -> b
runFn1 f = f

-- | Apply a function of two arguments
foreign import runFn2 :: forall a b c. Fn2 a b c -> a -> b -> c
Expand Down