@@ -607,28 +607,31 @@ module Arrays where
607 empty = []
607 empty = []
608 (<|>) = concat
608 (<|>) = concat
610−module Tuple where
610+module Tuples where
612 import Prelude
612 import Prelude
613 import Arrays
613 import Arrays
615− type Tuple a b = { fst :: a, snd :: b }
615+ data Tuple a b = Tuple { fst :: a, snd :: b }
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 ++ ")"
617 curry :: forall a b c. (Tuple a b -> c) -> a -> b -> c
620 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)
620 uncurry :: forall a b c. (a -> b -> c) -> Tuple a b -> c
623 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
623 tuple :: forall a b. a -> b -> Tuple a b
626 tuple :: forall a b. a -> b -> Tuple a b
624− tuple = curry (\t -> t)
627+ tuple a b = Tuple { fst: a, snd: b }
626 zip :: forall a b. [a] -> [b] -> [Tuple a b]
629 zip :: forall a b. [a] -> [b] -> [Tuple a b]
627 zip = zipWith tuple
630 zip = zipWith tuple
629 unzip :: forall a b. [Tuple a b] -> Tuple [a] [b]
632 unzip :: forall a b. [Tuple a b] -> Tuple [a] [b]
630− unzip (t:ts) = case unzip ts of
633+ unzip ((Tuple t):ts) = case unzip ts of
631− { fst = as, snd = bs } -> tuple (t.fst : as) (t.snd : bs)
634+ Tuple { fst = as, snd = bs } -> tuple (t.fst : as) (t.snd : bs)
632 unzip [] = tuple [] []
635 unzip [] = tuple [] []
634module String where
637module String where
@@ -996,6 +999,10 @@ module IORef where
997 \}" :: forall s r. IORef s -> s -> Eff (ref :: Ref | r) {}
1000 \}" :: forall s r. IORef s -> s -> Eff (ref :: Ref | r) {}
1002+ foreign import unsafeRunIORef "function unsafeRunIORef(f) {\
1004+ \}" :: forall eff a. Eff (ref :: Ref | eff) a -> Eff eff a
999module Trace where
1006module Trace where
1001 import Prelude
1008 import Prelude