git.iko.soy/rowtype-yoga/purescript-native
on golang help sign in
Prelude updates
07afa04Phil Freeman
libraries/prelude/prelude.purs+14−7
@@ -607,28 +607,31 @@ module Arrays where
607 empty = []
607 empty = []
608 (<|>) = concat
608 (<|>) = concat
609
609
610−module Tuple where
610+module Tuples where
611
611
612 import Prelude
612 import Prelude
613 import Arrays
613 import Arrays
614
614
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 ++ ")"
616
619
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)
619
622
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
622
625
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 }
625
628
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
628
631
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 [] []
633
636
634module String where
637module String where
@@ -996,6 +999,10 @@ module IORef where
996 \ };\
999 \ };\
997 \}" :: forall s r. IORef s -> s -> Eff (ref :: Ref | r) {}
1000 \}" :: forall s r. IORef s -> s -> Eff (ref :: Ref | r) {}
998
1001
1002+ foreign import unsafeRunIORef "function unsafeRunIORef(f) {\
1003+ \ return f;\
1004+ \}" :: forall eff a. Eff (ref :: Ref | eff) a -> Eff eff a
1005+
999module Trace where
1006module Trace where
1000
1007
1001 import Prelude
1008 import Prelude
purescript.cabal+2−2
@@ -1,5 +1,5 @@
1name: purescript
1name: purescript
2−version: 0.3.9.1
2+version: 0.3.10
3cabal-version: >=1.8
3cabal-version: >=1.8
4build-type: Simple
4build-type: Simple
5license: MIT
5license: MIT
@@ -17,7 +17,7 @@ data-dir: ""
17library
17library
18 build-depends: base >=4 && <5, cmdtheline -any, containers -any,
18 build-depends: base >=4 && <5, cmdtheline -any, containers -any,
19 directory -any, filepath -any, mtl -any, parsec -any, syb -any,
19 directory -any, filepath -any, mtl -any, parsec -any, syb -any,
20− transformers -any, utf8-string -any, pattern-arrows -any, monad-unify -any
20+ transformers -any, utf8-string -any, pattern-arrows -any, monad-unify >= 0.2 && < 0.3
21 exposed-modules: Data.Generics.Extras
21 exposed-modules: Data.Generics.Extras
22 Language.PureScript
22 Language.PureScript
23 Language.PureScript.Options
23 Language.PureScript.Options