git.iko.soy/rowtype-yoga/purescript-native
on golang help sign in
Add newtype parsing tests
commit11930f04906c548f4b32c8abffe374961bb57e61 authorGary Burgess <gary.burgess@gmail.com> dateSat 26 Jul 2014, 12:08 (12 years ago) parent99f82ce
4 files changed+28
examples/failing/NewtypeMultiArgs.purs+3 examples/failing/NewtypeMultiCtor.purs+3 examples/failing/NewtypeMultiParams.purs+3 examples/passing/Newtype.purs+19
examples/failing/NewtypeMultiArgs.pursnew file+3
@@ -0,0 +1,3 @@
1+module Main where
2+
3+newtype Thing = Thing String Boolean
examples/failing/NewtypeMultiCtor.pursnew file+3
@@ -0,0 +1,3 @@
1+module Main where
2+
3+newtype Thing = Thing String | Other
examples/failing/NewtypeMultiParams.pursnew file+3
@@ -0,0 +1,3 @@
1+module Main where
2+
3+newtype Thing a b = Thing a b
examples/passing/Newtype.pursnew file+19
@@ -0,0 +1,19 @@
1+module Main where
2+
3+import Control.Monad.Eff
4+import Debug.Trace
5+
6+newtype Thing = Thing String
7+
8+instance showThing :: Show Thing where
9+ show (Thing x) = "Thing " ++ show x
10+
11+newtype Box a = Box a
12+
13+instance showBox :: (Show a) => Show (Box a) where
14+ show (Box x) = "Box " ++ show x
15+
16+main = do
17+ print $ Thing "hello"
18+ print $ Box 42
19+ trace "Done"