@@ -313,19 +313,19 @@ module Prelude
314 instance ordUnit :: Ord Unit where
314 instance ordUnit :: Ord Unit where
315 compare (Unit {}) (Unit {}) = EQ
315 compare (Unit {}) (Unit {}) = EQ
317 instance ordBoolean :: Ord Boolean where
317 instance ordBoolean :: Ord Boolean where
318 compare false false = EQ
318 compare false false = EQ
319 compare false true = LT
319 compare false true = LT
320 compare true true = EQ
320 compare true true = EQ
321 compare true false = GT
321 compare true false = GT
323 instance ordNumber :: Ord Number where
323 instance ordNumber :: Ord Number where
324 compare = unsafeCompare
324 compare = unsafeCompare
326 instance ordString :: Ord String where
326 instance ordString :: Ord String where
327 compare = unsafeCompare
327 compare = unsafeCompare
329 instance ordArray :: (Ord a) => Ord [a] where
329 instance ordArray :: (Ord a) => Ord [a] where
330 compare [] [] = EQ
330 compare [] [] = EQ
331 compare [] _ = LT
331 compare [] _ = LT
@@ -453,6 +453,115 @@ module Data.Function where
453 on :: forall a b c. (b -> b -> c) -> (a -> b) -> a -> a -> c
453 on :: forall a b c. (b -> b -> c) -> (a -> b) -> a -> a -> c
454 on f g x y = g x `f` g y
454 on f g x y = g x `f` g y
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 :: * -> * -> * -> * -> * -> * -> *
463+ foreign import mkFn0
464+ "function mkFn0(f) {\
465+ \ return function() {\
468+ \}" :: forall a. (Unit -> a) -> Fn0 a
470+ foreign import mkFn1
471+ "function mkFn1(f) {\
472+ \ return function(a) {\
475+ \}" :: forall a b. (a -> b) -> Fn1 a b
477+ foreign import mkFn2
478+ "function mkFn2(f) {\
479+ \ return function(a, b) {\
482+ \}" :: forall a b c. (a -> b -> c) -> Fn2 a b c
484+ foreign import mkFn3
485+ "function mkFn3(f) {\
486+ \ return function(a, b, c) {\
487+ \ return f(a)(b)(c);\
489+ \}" :: forall a b c d. (a -> b -> c -> d) -> Fn3 a b c d
491+ foreign import mkFn4
492+ "function mkFn4(f) {\
493+ \ return function(a, b, c, d) {\
494+ \ return f(a)(b)(c)(d);\
496+ \}" :: forall a b c d e. (a -> b -> c -> d -> e) -> Fn4 a b c d e
498+ foreign import mkFn5
499+ "function mkFn5(f) {\
500+ \ return function(a, b, c, d, e) {\
501+ \ return f(a)(b)(c)(d)(e);\
503+ \}" :: forall a b c d e f. (a -> b -> c -> d -> e -> f) -> Fn5 a b c d e f
505+ foreign import runFn0
506+ "function runFn0(f) {\
508+ \}" :: forall a. Fn0 a -> a
510+ foreign import runFn1
511+ "function runFn1(f) {\
512+ \ return function(a) {\
515+ \}" :: forall a b. Fn1 a b -> a -> b
517+ foreign import runFn2
518+ "function runFn2(f) {\
519+ \ return function(a) {\
520+ \ return function(b) {\
524+ \}" :: forall a b c. Fn2 a b c -> a -> b -> c
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);\
535+ \}" :: forall a b c d. Fn3 a b c d -> a -> b -> c -> d
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);\
548+ \}" :: forall a b c d e. Fn4 a b c d e -> a -> b -> c -> d -> e
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);\
563+ \}" :: forall a b c d e f. Fn5 a b c d e f -> a -> b -> c -> d -> e -> f
456module Data.Eq where
565module Data.Eq where
458 data Ref a = Ref a
567 data Ref a = Ref a