@@ -607,28 +607,31 @@ module Arrays where
607607 empty = []
608608 (<|>) = concat
609609
610−module Tuple where
610+module Tuples where
611611
612612 import Prelude
613613 import Arrays
614614
615− type Tuple a b = { fst :: a, snd :: b }
615+ data Tuple a b = Tuple { fst :: a, snd :: b }
616+
617+ instance (Prelude.Show a, Prelude.Show b) => Prelude.Show (Tuple a b) where
618+ show (Tuple { fst = a, snd = b }) = "Tuple(" ++ show a ++ ", " ++ show b ++ ")"
616619
617620 curry :: forall a b c. (Tuple a b -> c) -> a -> b -> c
618− curry f a b = f { fst: a, snd: b }
621+ curry f a b = f (tuple a b)
619622
620623 uncurry :: forall a b c. (a -> b -> c) -> Tuple a b -> c
621− uncurry f t = f t.fst t.snd
624+ uncurry f (Tuple t) = f t.fst t.snd
622625
623626 tuple :: forall a b. a -> b -> Tuple a b
624− tuple = curry (\t -> t)
627+ tuple a b = Tuple { fst: a, snd: b }
625628
626629 zip :: forall a b. [a] -> [b] -> [Tuple a b]
627630 zip = zipWith tuple
628631
629632 unzip :: forall a b. [Tuple a b] -> Tuple [a] [b]
630− unzip (t:ts) = case unzip ts of
631− { fst = as, snd = bs } -> tuple (t.fst : as) (t.snd : bs)
633+ unzip ((Tuple t):ts) = case unzip ts of
634+ Tuple { fst = as, snd = bs } -> tuple (t.fst : as) (t.snd : bs)
632635 unzip [] = tuple [] []
633636
634637module String where
@@ -996,6 +999,10 @@ module IORef where
996999 \ };\
9971000 \}" :: forall s r. IORef s -> s -> Eff (ref :: Ref | r) {}
9981001
1002+ foreign import unsafeRunIORef "function unsafeRunIORef(f) {\
1003+ \ return f;\
1004+ \}" :: forall eff a. Eff (ref :: Ref | eff) a -> Eff eff a
1005+
9991006module Trace where
10001007
10011008 import Prelude