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:
ee7c1ce
)
Chaining with andThen works but is ugly.
author
sforman
<sforman@hushmail.com>
Sat, 2 Sep 2023 16:38:15 +0000
(09:38 -0700)
committer
sforman
<sforman@hushmail.com>
Sat, 2 Sep 2023 16:38:15 +0000
(09:38 -0700)
It's lees clear to me what's going on, and I wrote it.
implementations/Elm/src/Joy.elm
patch
|
blob
|
history
diff --git
a/implementations/Elm/src/Joy.elm
b/implementations/Elm/src/Joy.elm
index
0099016
..
3a67534
100644
(file)
--- a/
implementations/Elm/src/Joy.elm
+++ b/
implementations/Elm/src/Joy.elm
@@
-507,17
+507,7
@@
joy_swaack stack expression =
joy_swap : JoyFunction
joy_swap stack expression =
- case pop_any stack of
- Ok ( a, s0 ) ->
- case pop_any s0 of
- Ok ( b, s1 ) ->
- Ok ( b :: a :: s1, expression )
-
- Err msg ->
- Err msg
-
- Err msg ->
- Err msg
+ pop_any stack |> andThen (\(a, s0) -> (pop_any s0 |> andThen (\( b, s1 ) -> Ok ( b :: a :: s1, expression ))))
joy_truthy : JoyFunction