Skip to content

Commit 01cda32

Browse files
committed
Update to 0.2.1.1
1 parent 941f563 commit 01cda32

File tree

2 files changed

+14
-16
lines changed

2 files changed

+14
-16
lines changed

Main.hs

Lines changed: 13 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -96,15 +96,15 @@ examples =
9696
, ""
9797
, "foreign import numberToString :: Number -> String"
9898
, ""
99-
, "showPerson = \\p -> case p of"
100-
, " Person o -> o.name ++ \", aged \" ++ numberToString o.age"
99+
, "showPerson (Person { name = name, age = age }) ="
100+
, " name ++ \", aged \" ++ numberToString age"
101101
]))
102102
, ("ops",
103103
("Operators",
104104
unlines [ "infixl 5 |>"
105105
, ""
106106
, "(|>) :: forall a b c. (a -> b) -> (b -> c) -> a -> c"
107-
, "(|>) = \\f -> \\g -> \\a -> g (f a)"
107+
, "(|>) f g a = g (f a)"
108108
, ""
109109
, "foreign import foo :: String -> Number"
110110
, "foreign import bar :: Number -> Boolean"
@@ -113,17 +113,15 @@ examples =
113113
]))
114114
, ("arrays",
115115
("Arrays",
116-
unlines [ "sum = \\arr -> case arr of"
117-
, " x : xs -> x + sum xs"
118-
, " [] -> 0"
116+
unlines [ "sum (x:xs) = x + sum xs"
117+
, "sum [] = 0"
119118
, ""
120-
, "sumOfProducts = \\arr -> case arr of"
121-
, " x : y : xs -> x * y + sum xs"
122-
, " _ -> 0"
119+
, "sumOfProducts (x : y : xs) = x * y + sum xs"
120+
, "sumOfProducts _ = 0"
123121
]))
124122
, ("rows",
125123
("Row Polymorphism",
126-
unlines [ "showPerson = \\o -> o.lastName ++ \", \" ++ o.firstName"
124+
unlines [ "showPerson o = o.lastName ++ \", \" ++ o.firstName"
127125
]))
128126
, ("ffi",
129127
("FFI",
@@ -136,7 +134,7 @@ examples =
136134
, ("blocks",
137135
("Mutable Variables",
138136
unlines [ "collatz :: Number -> Number"
139-
, "collatz = \\n -> "
137+
, "collatz n ="
140138
, " { "
141139
, " var m = n;"
142140
, " var count = 0;"
@@ -156,7 +154,7 @@ examples =
156154
unlines [ "module Test where"
157155
, ""
158156
, " incr :: Number -> Number"
159-
, " incr = \\x -> x + 1"
157+
, " incr x = x + 1"
160158
, ""
161159
, "test = Test.incr 10"
162160
]))
@@ -165,15 +163,15 @@ examples =
165163
unlines [ "type Nat = forall a. a -> (a -> a) -> a"
166164
, ""
167165
, "zero :: Nat"
168-
, "zero = \\a f -> a"
166+
, "zero a _ = a"
169167
, ""
170168
, "succ :: Nat -> Nat"
171-
, "succ = \\n a f -> f (n a f)"
169+
, "succ n a f = f (n a f)"
172170
, ""
173171
, "type Lens a b = forall f. (a -> f a) -> b -> f b"
174172
, ""
175173
, "compose :: forall a b c. Lens a b -> Lens b c -> Lens a c"
176-
, "compose = \\l1 l2 f -> l2 (l1 f)"
174+
, "compose l1 l2 f = l2 (l1 f)"
177175
]))
178176
]
179177

trypurescript.cabal

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ author: Phil Freeman
1313
data-dir: ""
1414

1515
executable trypurescript
16-
build-depends: base ==4.*, scotty -any, purescript ==0.2.0, containers -any,
16+
build-depends: base ==4.*, scotty -any, purescript ==0.2.1.1, containers -any,
1717
mtl -any, blaze-html -any, cmdtheline -any
1818
main-is: Main.hs
1919
buildable: True

0 commit comments

Comments
 (0)