@@ -313,19 +313,19 @@ module Prelude
313313
314314 instance ordUnit :: Ord Unit where
315315 compare (Unit {}) (Unit {}) = EQ
316−
316+
317317 instance ordBoolean :: Ord Boolean where
318318 compare false false = EQ
319319 compare false true = LT
320320 compare true true = EQ
321321 compare true false = GT
322−
322+
323323 instance ordNumber :: Ord Number where
324324 compare = unsafeCompare
325−
325+
326326 instance ordString :: Ord String where
327327 compare = unsafeCompare
328−
328+
329329 instance ordArray :: (Ord a) => Ord [a] where
330330 compare [] [] = EQ
331331 compare [] _ = LT
@@ -453,6 +453,115 @@ module Data.Function where
453453 on :: forall a b c. (b -> b -> c) -> (a -> b) -> a -> a -> c
454454 on f g x y = g x `f` g y
455455
456+ foreign import data Fn0 :: * -> *
457+ foreign import data Fn1 :: * -> * -> *
458+ foreign import data Fn2 :: * -> * -> * -> *
459+ foreign import data Fn3 :: * -> * -> * -> * -> *
460+ foreign import data Fn4 :: * -> * -> * -> * -> * -> *
461+ foreign import data Fn5 :: * -> * -> * -> * -> * -> * -> *
462+
463+ foreign import mkFn0
464+ "function mkFn0(f) {\
465+ \ return function() {\
466+ \ return f({});\
467+ \ };\
468+ \}" :: forall a. (Unit -> a) -> Fn0 a
469+
470+ foreign import mkFn1
471+ "function mkFn1(f) {\
472+ \ return function(a) {\
473+ \ return f(a);\
474+ \ };\
475+ \}" :: forall a b. (a -> b) -> Fn1 a b
476+
477+ foreign import mkFn2
478+ "function mkFn2(f) {\
479+ \ return function(a, b) {\
480+ \ return f(a)(b);\
481+ \ };\
482+ \}" :: forall a b c. (a -> b -> c) -> Fn2 a b c
483+
484+ foreign import mkFn3
485+ "function mkFn3(f) {\
486+ \ return function(a, b, c) {\
487+ \ return f(a)(b)(c);\
488+ \ };\
489+ \}" :: forall a b c d. (a -> b -> c -> d) -> Fn3 a b c d
490+
491+ foreign import mkFn4
492+ "function mkFn4(f) {\
493+ \ return function(a, b, c, d) {\
494+ \ return f(a)(b)(c)(d);\
495+ \ };\
496+ \}" :: forall a b c d e. (a -> b -> c -> d -> e) -> Fn4 a b c d e
497+
498+ foreign import mkFn5
499+ "function mkFn5(f) {\
500+ \ return function(a, b, c, d, e) {\
501+ \ return f(a)(b)(c)(d)(e);\
502+ \ };\
503+ \}" :: forall a b c d e f. (a -> b -> c -> d -> e -> f) -> Fn5 a b c d e f
504+
505+ foreign import runFn0
506+ "function runFn0(f) {\
507+ \ return f();\
508+ \}" :: forall a. Fn0 a -> a
509+
510+ foreign import runFn1
511+ "function runFn1(f) {\
512+ \ return function(a) {\
513+ \ return f(a);\
514+ \ };\
515+ \}" :: forall a b. Fn1 a b -> a -> b
516+
517+ foreign import runFn2
518+ "function runFn2(f) {\
519+ \ return function(a) {\
520+ \ return function(b) {\
521+ \ return f(a, b);\
522+ \ };\
523+ \ };\
524+ \}" :: forall a b c. Fn2 a b c -> a -> b -> c
525+
526+ foreign import runFn3
527+ "function runFn3(f) {\
528+ \ return function(a) {\
529+ \ return function(b) {\
530+ \ return function(c) {\
531+ \ return f(a, b, c);\
532+ \ };\
533+ \ };\
534+ \ };\
535+ \}" :: forall a b c d. Fn3 a b c d -> a -> b -> c -> d
536+
537+ foreign import runFn4
538+ "function runFn4(f) {\
539+ \ return function(a) {\
540+ \ return function(b) {\
541+ \ return function(c) {\
542+ \ return function(d) {\
543+ \ return f(a, b, c, d);\
544+ \ };\
545+ \ };\
546+ \ };\
547+ \ };\
548+ \}" :: forall a b c d e. Fn4 a b c d e -> a -> b -> c -> d -> e
549+
550+ foreign import runFn5
551+ "function runFn5(f) {\
552+ \ return function(a) {\
553+ \ return function(b) {\
554+ \ return function(c) {\
555+ \ return function(d) {\
556+ \ return function(e) {\
557+ \ return f(a, b, c, d, e);\
558+ \ };\
559+ \ };\
560+ \ };\
561+ \ };\
562+ \ };\
563+ \}" :: forall a b c d e f. Fn5 a b c d e f -> a -> b -> c -> d -> e -> f
564+
456565module Data.Eq where
457566
458567 data Ref a = Ref a