git.iko.soy/rowtype-yoga/purescript-native
on golang help sign in
More work on examples
80a4d8ePhil Freeman
examples/Nested.psnew file+3
@@ -0,0 +1,3 @@
1+data Extend r a = Extend { prev :: r a; next :: a }
2+
3+data Matrix r a = Square (r (r a)) | Bigger (Matrix (Extend r) a)
examples/Operators.ps+4
@@ -13,3 +13,7 @@ test4 = 1 `k` 2
13test5 = 1 %% 2 %% 3
13test5 = 1 %% 2 %% 3
14
14
15test6 = ((\x -> x) `k` 2) 3
15test6 = ((\x -> x) `k` 2) 3
16+
17+(<>) = \s1 -> \s2 -> s1 ++ s2
18+
19+test7 = "Hello" <> "World!"
examples/Patterns.ps+4
@@ -2,3 +2,7 @@ test = \x -> case x of
2 { str = "Foo", bool = true } -> true
2 { str = "Foo", bool = true } -> true
3 { str = "Bar", bool = b } -> b
3 { str = "Bar", bool = b } -> b
4 _ -> false
4 _ -> false
5+
6+f = \o -> case o of
7+ { foo = "Foo" } -> o.bar
8+ _ -> 0