@@ -97,8 +97,10 @@ module Arrays where
98 foreign import splice :: forall a. Number -> Number -> [a] -> [a] -> [a]
98 foreign import splice :: forall a. Number -> Number -> [a] -> [a] -> [a]
100− cons :: forall a. a -> [a] -> [a]
102+ (:) :: forall a. a -> [a] -> [a]
101− cons a = concat [a]
103+ (:) a = concat [a]
103 concatMap :: forall a b. [a] -> (a -> [b]) -> [b]
105 concatMap :: forall a b. [a] -> (a -> [b]) -> [b]
104 concatMap as f = {
106 concatMap as f = {
@@ -125,7 +127,7 @@ module Arrays where
127 zipWith :: forall a b c. (a -> b -> c) -> [a] -> [b] -> [c]
129 zipWith :: forall a b c. (a -> b -> c) -> [a] -> [b] -> [c]
128− zipWith f (a:as) (b:bs) = cons (f a b) (zipWith f as bs)
130+ zipWith f (a:as) (b:bs) = f a b : zipWith f as bs
129 zipWith _ _ _ = []
131 zipWith _ _ _ = []
131 any :: forall a. (a -> Boolean) -> [a] -> Boolean
133 any :: forall a. (a -> Boolean) -> [a] -> Boolean
@@ -168,7 +170,7 @@ module Tuple where
169 unzip :: forall a b. [Tuple a b] -> Tuple [a] [b]
171 unzip :: forall a b. [Tuple a b] -> Tuple [a] [b]
170 unzip (t:ts) = case unzip ts of
172 unzip (t:ts) = case unzip ts of
171− { fst = as, snd = bs } -> tuple (cons t.fst as) (cons t.snd bs)
173+ { fst = as, snd = bs } -> tuple (t.fst : as) (t.snd : bs)
172 unzip [] = tuple [] []
174 unzip [] = tuple [] []
174module String where
176module String where