git.iko.soy/rowtype-yoga/purescript-native
on golang help sign in
Prelude updates
commit07afa04161fbdd4e6b35b10284bea097c2471bd8 authorPhil Freeman <paf31@cantab.net> dateFri 7 Feb 2014, 16:13 (13 years ago) parente5ffbf9
2 files changed+16−9
libraries/prelude/prelude.purs+14−7 purescript.cabal+2−2
libraries/prelude/prelude.purs+14−7
@@ -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
purescript.cabal+2−2
@@ -1,5 +1,5 @@
11name: purescript
2−version: 0.3.9.1
2+version: 0.3.10
33cabal-version: >=1.8
44build-type: Simple
55license: MIT
@@ -17,7 +17,7 @@ data-dir: ""
1717library
1818 build-depends: base >=4 && <5, cmdtheline -any, containers -any,
1919 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
2121 exposed-modules: Data.Generics.Extras
2222 Language.PureScript
2323 Language.PureScript.Options