OSDN Git Service
(root)
/
joypy
/
Thun.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
590a5b2
)
A start on Joy types.
author
sforman
<sforman@hushmail.com>
Fri, 28 Jul 2023 22:04:35 +0000
(15:04 -0700)
committer
sforman
<sforman@hushmail.com>
Fri, 28 Jul 2023 22:04:35 +0000
(15:04 -0700)
implementations/Elm/src/Joy.elm
[new file with mode: 0644]
patch
|
blob
diff --git a/implementations/Elm/src/Joy.elm
b/implementations/Elm/src/Joy.elm
new file mode 100644
(file)
index 0000000..
5d5c641
--- /dev/null
+++ b/
implementations/Elm/src/Joy.elm
@@ -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)) ++ "]"
+