git.iko.soy/rowtype-yoga/purescript-native
on golang help sign in
Add tests for records and nested types
commit8838396090833e4d8cc8e3d4ac6b24800d4a44cc authorPhil Freeman <paf31@cantab.net> dateSat 6 Feb 2016, 16:45 (11 years ago) parent6bbecf2
1 file changed+6
examples/passing/Deriving.purs+6
examples/passing/Deriving.purs+6
@@ -9,6 +9,10 @@ derive instance eqX :: Eq X
99
1010derive instance ordX :: Ord X
1111
12+newtype Z = Z { left :: X, right :: X }
13+
14+derive instance eqZ :: Eq Z
15+
1216main = do
1317 assert $ X 0 == X 0
1418 assert $ X 0 /= X 1
@@ -17,3 +21,5 @@ main = do
1721 assert $ X 0 < X 1
1822 assert $ X 0 < Y "Foo"
1923 assert $ Y "Bar" < Y "Baz"
24+ assert $ z == z where
25+ z = Z { left: X 0, right: Y "Foo" }