File tree Expand file tree Collapse file tree 1 file changed +12
-12
lines changed Expand file tree Collapse file tree 1 file changed +12
-12
lines changed Original file line number Diff line number Diff line change @@ -43,7 +43,7 @@ press `Ctrl-d`.
4343
4444When you enter an expression, you get the result and its type:
4545
46- ```
46+ ```elm
4747> 1 + 1
48482 : number
4949
@@ -53,7 +53,7 @@ When you enter an expression, you get the result and its type:
5353
5454The same can be done with definitions of values and functions:
5555
56- ```
56+ ```elm
5757> fortyOne = 41
585841 : number
5959
@@ -64,22 +64,22 @@ The same can be done with definitions of values and functions:
646442 : number
6565
6666> factorial n = \\
67- | if n < 1 then 1 \\
68- | else n * factorial (n-1)
67+ | if n < 1 then 1 else n * factorial (n-1)
6968<function> : number -> number
7069
7170> factorial 5
7271120 : number
7372```
7473
75- You can also define ADTs :
74+ You can also define union types :
7675
77- ```
78- > data List a = Nil | Cons a (List a)
76+ ```elm
77+ > type List a = Nil | Cons a (List a)
7978
80- > isNil xs = case xs of \\
81- | Nil -> True \\
82- | Cons _ _ -> False
79+ > isNil xs = \\
80+ | case xs of \\
81+ | Nil -> True \\
82+ | Cons _ _ -> False
8383<function> : List a -> Bool
8484
8585> isNil Nil
@@ -90,7 +90,7 @@ You can also import standard libraries and any library reachable
9090from the directory in which `elm-repl` is running. Let's say you
9191are working on a module called `Graph`:
9292
93- ```
93+ ```elm
9494> import String
9595
9696> String.length "hello"
@@ -153,4 +153,4 @@ which provided lots of great infrastructure for this project.
153153
154154 [repl-request]: https://groups.google.com/forum/#!searchin/elm-discuss/repl/elm-discuss/OqT-HjGCkyY/sGvDAcb8Y84J
155155
156- """
156+ """
You can’t perform that action at this time.
0 commit comments