@@ -516,8 +516,8 @@ module Arrays where
516516 foldl _ b [] = b
517517 foldl f b (a:as) = foldl f (f a b) as
518518
519− foreign import length "function length(xs) { \
520− \ return xs.length; \
519+ foreign import length "function length(xs) {\
520+ \ return xs.length;\
521521 \}" :: forall a. [a] -> Number
522522
523523 foreign import indexOf "function indexOf(l) {\
@@ -584,7 +584,7 @@ module Arrays where
584584
585585 foreign import splice "function splice(s) {\
586586 \ return function(e) {\
587− \ return function(l1) { \
587+ \ return function(l1) {\
588588 \ return function(l2) {\
589589 \ return l2.splice(s, e, l1);\
590590 \ }; \
@@ -654,27 +654,24 @@ module Tuples where
654654 import Prelude
655655 import Arrays
656656
657− data Tuple a b = Tuple { fst :: a, snd :: b }
657+ data Tuple a b = Tuple a b
658658
659659 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 ++ ")"
661661
662662 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)
664664
665665 uncurry :: forall a b c. (a -> b -> c) -> Tuple a b -> c
666− uncurry f (Tuple t) = f t.fst t.snd
667−
668− tuple :: forall a b. a -> b -> Tuple a b
669− tuple a b = Tuple { fst: a, snd: b }
666+ uncurry f (Tuple a b) = f a b
670667
671668 zip :: forall a b. [a] -> [b] -> [Tuple a b]
672− zip = zipWith tuple
669+ zip = zipWith Tuple
673670
674671 unzip :: forall a b. [Tuple a b] -> Tuple [a] [b]
675− unzip ((Tuple t):ts) = case unzip ts of
676− Tuple { fst = as, snd = bs } -> tuple (t.fst : as) (t.snd : bs)
677− unzip [] = tuple [] []
672+ unzip ((Tuple a b):ts) = case unzip ts of
673+ Tuple as bs -> Tuple (a : as) (b : bs)
674+ unzip [] = Tuple [] []
678675
679676module String where
680677
@@ -701,7 +698,7 @@ module String where
701698 \}" :: String -> String -> Number
702699
703700 foreign import localeCompare "function localeCompare(s1) {\
704− \ return function(s2) { \
701+ \ return function(s2) {\
705702 \ return s1.localeCompare(s2);\
706703 \ };\
707704 \}" :: String -> String -> Number
@@ -767,7 +764,7 @@ module Regex where
767764 \}" :: String -> String -> Regex
768765
769766 foreign import test "function test(r) {\
770− \ return function (s) { \
767+ \ return function (s) {\
771768 \ return r.test(s);\
772769 \ };\
773770 \}" :: Regex -> String -> Boolean
@@ -780,7 +777,7 @@ module Regex where
780777
781778 foreign import replaceR "function replaceR(r) {\
782779 \ return function(s1) {\
783− \ return function(s2) { \
780+ \ return function(s2) {\
784781 \ return s2.replace(r, s1);\
785782 \ };\
786783 \ };\
@@ -906,24 +903,24 @@ module Eff where
906903
907904 foreign import data Eff :: # ! -> * -> *
908905
909− foreign import retEff "function retEff(a) { \
910− \ return function() { \
911− \ return a; \
912− \ }; \
906+ foreign import retEff "function retEff(a) {\
907+ \ return function() {\
908+ \ return a;\
909+ \ };\
913910 \}" :: forall e a. a -> Eff e a
914911
915− foreign import bindEff "function bindEff(a) { \
916− \ return function(f) { \
917− \ return function() { \
918− \ return f(a())(); \
919− \ }; \
920− \ }; \
912+ foreign import bindEff "function bindEff(a) {\
913+ \ return function(f) {\
914+ \ return function() {\
915+ \ return f(a())();\
916+ \ };\
917+ \ };\
921918 \}" :: forall e a b. Eff e a -> (a -> Eff e b) -> Eff e b
922919
923920 type Pure a = forall e. Eff e a
924921
925− foreign import runPure "function runPure(f) { \
926− \ return f(); \
922+ foreign import runPure "function runPure(f) {\
923+ \ return f();\
927924 \}" :: forall a. Pure a -> a
928925
929926 instance Prelude.Monad (Eff e) where
@@ -986,22 +983,22 @@ module Errors where
986983
987984 foreign import data Error :: * -> !
988985
989− foreign import throwError "function throwError(e) { \
990− \ return function() { \
991− \ throw e; \
992− \ }; \
986+ foreign import throwError "function throwError(e) {\
987+ \ return function() {\
988+ \ throw e;\
989+ \ };\
993990 \}" :: forall a e r. e -> Eff (err :: Error e | r) a
994991
995− foreign import catchError "function catchError(c) { \
996− \ return function(t) { \
997− \ return function() { \
998− \ try { \
999− \ return t(); \
1000− \ } catch(e) { \
1001− \ return c(e)(); \
992+ foreign import catchError "function catchError(c) {\
993+ \ return function(t) {\
994+ \ return function() {\
995+ \ try {\
996+ \ return t();\
997+ \ } catch(e) {\
998+ \ return c(e)();\
1002999 \ }\
1003− \ }; \
1004− \ }; \
1000+ \ };\
1001+ \ };\
10051002 \}" :: forall e r a. (e -> Eff r a) -> Eff (err :: Error e | r) a -> Eff r a
10061003
10071004module IORef where
@@ -1054,11 +1051,11 @@ module Trace where
10541051
10551052 foreign import data Trace :: !
10561053
1057− foreign import trace "function trace(s) { \
1058− \ return function() { \
1059− \ console.log(s); \
1060− \ return {}; \
1061− \ }; \
1054+ foreign import trace "function trace(s) {\
1055+ \ return function() {\
1056+ \ console.log(s);\
1057+ \ return {};\
1058+ \ };\
10621059 \}" :: forall r. String -> Eff (trace :: Trace | r) {}
10631060
10641061 print :: forall a r. (Prelude.Show a) => a -> Eff (trace :: Trace | r) {}