A start on Joy types.
This commit is contained in:
parent
590a5b207c
commit
9d57545533
|
|
@ -0,0 +1,25 @@
|
|||
module Joy exposing (joyTermToString)
|
||||
|
||||
|
||||
type JoyType
|
||||
= Symbol String
|
||||
| Integer Int
|
||||
| JoyList (List JoyType)
|
||||
| JoyTrue
|
||||
| JoyFalse
|
||||
|
||||
|
||||
joyTermToString : JoyType -> String
|
||||
joyTermToString term =
|
||||
case term of
|
||||
Symbol name ->
|
||||
name
|
||||
Integer n ->
|
||||
String.fromInt n
|
||||
JoyTrue ->
|
||||
"true"
|
||||
JoyFalse ->
|
||||
"false"
|
||||
JoyList list ->
|
||||
"[" ++ (String.join " " (List.map joyTermToString list)) ++ "]"
|
||||
|
||||
Loading…
Reference in New Issue