File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1717 " package.json"
1818 ],
1919 "dependencies" : {
20- "purescript-prelude" : " ^1.0 .0"
20+ "purescript-prelude" : " ^2.1 .0"
2121 }
2222}
Original file line number Diff line number Diff line change @@ -8,12 +8,6 @@ exports.mkFn0 = function (fn) {
88 } ;
99} ;
1010
11- exports . mkFn1 = function ( fn ) {
12- return function ( a ) {
13- return fn ( a ) ;
14- } ;
15- } ;
16-
1711exports . mkFn2 = function ( fn ) {
1812 /* jshint maxparams: 2 */
1913 return function ( a , b ) {
@@ -81,12 +75,6 @@ exports.runFn0 = function (fn) {
8175 return fn ( ) ;
8276} ;
8377
84- exports . runFn1 = function ( fn ) {
85- return function ( a ) {
86- return fn ( a ) ;
87- } ;
88- } ;
89-
9078exports . runFn2 = function ( fn ) {
9179 return function ( a ) {
9280 return function ( b ) {
Original file line number Diff line number Diff line change @@ -6,7 +6,7 @@ import Data.Unit (Unit)
66foreign import data Fn0 :: * -> *
77
88-- | A function of one argument
9- foreign import data Fn1 :: * -> * -> *
9+ type Fn1 a b = a -> b
1010
1111-- | A function of two arguments
1212foreign import data Fn2 :: * -> * -> * -> *
@@ -39,7 +39,8 @@ foreign import data Fn10 :: * -> * -> * -> * -> * -> * -> * -> * -> * -> * -> *
3939foreign import mkFn0 :: forall a . (Unit -> a ) -> Fn0 a
4040
4141-- | Create a function of one argument
42- foreign import mkFn1 :: forall a b . (a -> b ) -> Fn1 a b
42+ mkFn1 :: forall a b . (a -> b ) -> Fn1 a b
43+ mkFn1 f = f
4344
4445-- | Create a function of two arguments from a curried function
4546foreign import mkFn2 :: forall a b c . (a -> b -> c ) -> Fn2 a b c
@@ -72,7 +73,8 @@ foreign import mkFn10 :: forall a b c d e f g h i j k. (a -> b -> c -> d -> e ->
7273foreign import runFn0 :: forall a . Fn0 a -> a
7374
7475-- | Apply a function of one argument
75- foreign import runFn1 :: forall a b . Fn1 a b -> a -> b
76+ runFn1 :: forall a b . Fn1 a b -> a -> b
77+ runFn1 f = f
7678
7779-- | Apply a function of two arguments
7880foreign import runFn2 :: forall a b c . Fn2 a b c -> a -> b -> c
You can’t perform that action at this time.
0 commit comments