More work on examples
commit80a4d8e9d55f28226f7d055c15b0cc06c407882c
authorPhil Freeman <paf31@cantab.net>
dateSat 26 Oct 2013, 14:01 (13 years ago)
parent69c028d
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
1313test5 = 1 %% 2 %% 3
1414
1515test6 = ((\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
22 { str = "Foo", bool = true } -> true
33 { str = "Bar", bool = b } -> b
44 _ -> false
5+
6+f = \o -> case o of
7+ { foo = "Foo" } -> o.bar
8+ _ -> 0