@@ -516,8 +516,8 @@ module Arrays where
516 foldl _ b [] = b
516 foldl _ b [] = b
517 foldl f b (a:as) = foldl f (f a b) as
517 foldl f b (a:as) = foldl f (f a b) as
519− foreign import length "function length(xs) { \
519+ foreign import length "function length(xs) {\
520− \ return xs.length; \
520+ \ return xs.length;\
521 \}" :: forall a. [a] -> Number
521 \}" :: forall a. [a] -> Number
523 foreign import indexOf "function indexOf(l) {\
523 foreign import indexOf "function indexOf(l) {\
@@ -584,7 +584,7 @@ module Arrays where
585 foreign import splice "function splice(s) {\
585 foreign import splice "function splice(s) {\
586 \ return function(e) {\
586 \ return function(e) {\
587− \ return function(l1) { \
587+ \ return function(l1) {\
588 \ return function(l2) {\
588 \ return function(l2) {\
589 \ return l2.splice(s, e, l1);\
589 \ return l2.splice(s, e, l1);\
@@ -654,27 +654,24 @@ module Tuples where
654 import Prelude
654 import Prelude
655 import Arrays
655 import Arrays
657− data Tuple a b = Tuple { fst :: a, snd :: b }
657+ data Tuple a b = Tuple a b
659 instance (Prelude.Show a, Prelude.Show b) => Prelude.Show (Tuple a b) where
659 instance (Prelude.Show a, Prelude.Show b) => Prelude.Show (Tuple a b) where
660− show (Tuple { fst = a, snd = b }) = "Tuple(" ++ show a ++ ", " ++ show b ++ ")"
660+ show (Tuple a b) = "Tuple(" ++ show a ++ ", " ++ show b ++ ")"
662 curry :: forall a b c. (Tuple a b -> c) -> a -> b -> c
662 curry :: forall a b c. (Tuple a b -> c) -> a -> b -> c
663− curry f a b = f (tuple a b)
663+ curry f a b = f (Tuple a b)
665 uncurry :: forall a b c. (a -> b -> c) -> Tuple a b -> c
665 uncurry :: forall a b c. (a -> b -> c) -> Tuple a b -> c
666− uncurry f (Tuple t) = f t.fst t.snd
666+ uncurry f (Tuple a b) = f a b
668− tuple :: forall a b. a -> b -> Tuple a b
669− tuple a b = Tuple { fst: a, snd: b }
671 zip :: forall a b. [a] -> [b] -> [Tuple a b]
668 zip :: forall a b. [a] -> [b] -> [Tuple a b]
672− zip = zipWith tuple
669+ zip = zipWith Tuple
674 unzip :: forall a b. [Tuple a b] -> Tuple [a] [b]
671 unzip :: forall a b. [Tuple a b] -> Tuple [a] [b]
675− unzip ((Tuple t):ts) = case unzip ts of
672+ unzip ((Tuple a b):ts) = case unzip ts of
676− Tuple { fst = as, snd = bs } -> tuple (t.fst : as) (t.snd : bs)
673+ Tuple as bs -> Tuple (a : as) (b : bs)
677− unzip [] = tuple [] []
674+ unzip [] = Tuple [] []
679module String where
676module String where
@@ -701,7 +698,7 @@ module String where
701 \}" :: String -> String -> Number
698 \}" :: String -> String -> Number
703 foreign import localeCompare "function localeCompare(s1) {\
700 foreign import localeCompare "function localeCompare(s1) {\
704− \ return function(s2) { \
701+ \ return function(s2) {\
705 \ return s1.localeCompare(s2);\
702 \ return s1.localeCompare(s2);\
707 \}" :: String -> String -> Number
704 \}" :: String -> String -> Number
@@ -767,7 +764,7 @@ module Regex where
767 \}" :: String -> String -> Regex
764 \}" :: String -> String -> Regex
769 foreign import test "function test(r) {\
766 foreign import test "function test(r) {\
770− \ return function (s) { \
767+ \ return function (s) {\
771 \ return r.test(s);\
768 \ return r.test(s);\
773 \}" :: Regex -> String -> Boolean
770 \}" :: Regex -> String -> Boolean
@@ -780,7 +777,7 @@ module Regex where
781 foreign import replaceR "function replaceR(r) {\
778 foreign import replaceR "function replaceR(r) {\
782 \ return function(s1) {\
779 \ return function(s1) {\
783− \ return function(s2) { \
780+ \ return function(s2) {\
784 \ return s2.replace(r, s1);\
781 \ return s2.replace(r, s1);\
@@ -906,24 +903,24 @@ module Eff where
907 foreign import data Eff :: # ! -> * -> *
904 foreign import data Eff :: # ! -> * -> *
909− foreign import retEff "function retEff(a) { \
906+ foreign import retEff "function retEff(a) {\
910− \ return function() { \
907+ \ return function() {\
911− \ return a; \
908+ \ return a;\
913 \}" :: forall e a. a -> Eff e a
910 \}" :: forall e a. a -> Eff e a
915− foreign import bindEff "function bindEff(a) { \
912+ foreign import bindEff "function bindEff(a) {\
916− \ return function(f) { \
913+ \ return function(f) {\
917− \ return function() { \
914+ \ return function() {\
918− \ return f(a())(); \
915+ \ return f(a())();\
921 \}" :: forall e a b. Eff e a -> (a -> Eff e b) -> Eff e b
918 \}" :: forall e a b. Eff e a -> (a -> Eff e b) -> Eff e b
923 type Pure a = forall e. Eff e a
920 type Pure a = forall e. Eff e a
925− foreign import runPure "function runPure(f) { \
922+ foreign import runPure "function runPure(f) {\
926− \ return f(); \
923+ \ return f();\
927 \}" :: forall a. Pure a -> a
924 \}" :: forall a. Pure a -> a
929 instance Prelude.Monad (Eff e) where
926 instance Prelude.Monad (Eff e) where
@@ -986,22 +983,22 @@ module Errors where
987 foreign import data Error :: * -> !
984 foreign import data Error :: * -> !
989− foreign import throwError "function throwError(e) { \
986+ foreign import throwError "function throwError(e) {\
990− \ return function() { \
987+ \ return function() {\
991− \ throw e; \
988+ \ throw e;\
993 \}" :: forall a e r. e -> Eff (err :: Error e | r) a
990 \}" :: forall a e r. e -> Eff (err :: Error e | r) a
995− foreign import catchError "function catchError(c) { \
992+ foreign import catchError "function catchError(c) {\
996− \ return function(t) { \
993+ \ return function(t) {\
997− \ return function() { \
994+ \ return function() {\
998− \ try { \
995+ \ try {\
999− \ return t(); \
996+ \ return t();\
1000− \ } catch(e) { \
997+ \ } catch(e) {\
1001− \ return c(e)(); \
998+ \ return c(e)();\
1005 \}" :: forall e r a. (e -> Eff r a) -> Eff (err :: Error e | r) a -> Eff r a
1002 \}" :: forall e r a. (e -> Eff r a) -> Eff (err :: Error e | r) a -> Eff r a
1007module IORef where
1004module IORef where
@@ -1054,11 +1051,11 @@ module Trace where
1055 foreign import data Trace :: !
1052 foreign import data Trace :: !
1057− foreign import trace "function trace(s) { \
1054+ foreign import trace "function trace(s) {\
1058− \ return function() { \
1055+ \ return function() {\
1059− \ console.log(s); \
1056+ \ console.log(s);\
1060− \ return {}; \
1057+ \ return {};\
1062 \}" :: forall r. String -> Eff (trace :: Trace | r) {}
1059 \}" :: forall r. String -> Eff (trace :: Trace | r) {}
1064 print :: forall a r. (Prelude.Show a) => a -> Eff (trace :: Trace | r) {}
1061 print :: forall a r. (Prelude.Show a) => a -> Eff (trace :: Trace | r) {}