on master help sign in
temporarily switch to old style in REPL hints
9d97114Evan Czaplicki
hints/repl.md+4−13
@@ -28,26 +28,17 @@ The same can be done with definitions and custom types:
28> increment 41
28> increment 41
2942 : number
2942 : number
30
30
31−> factorial n =
32−| if n < 1 then
33−| 1
34−| else
35−| n * factorial (n-1)
31+> factorial n = if n < 1 then 1 else n * factorial (n-1)
36−|
37<function> : number -> number
32<function> : number -> number
38
33
39> factorial 5
34> factorial 5
40120 : number
35120 : number
41
36
42−> type User
43−| = Regular String
37+> type User = Regular String | Visitor String
44−| | Visitor String
45−|
46
38
47−> case Regular "Tom" of
39+> case Regular "Tom" of \
48−| Regular name -> "Hey again!"
40+| Regular name -> "Hey again!" /
49| Visitor name -> "Nice to meet you!"
41| Visitor name -> "Nice to meet you!"
50−|
51"Hey again!" : String
42"Hey again!" : String
52```
43```
53
44