Don't use andThen.

It's less clear than spelling it all out.
This commit is contained in:
sforman 2023-09-02 09:44:57 -07:00
parent b65e948cce
commit 4f27f3305f
1 changed files with 11 additions and 1 deletions

View File

@ -507,7 +507,17 @@ joy_swaack stack expression =
joy_swap : JoyFunction
joy_swap stack expression =
pop_any stack |> andThen (\(a, s0) -> (pop_any s0 |> andThen (\( b, s1 ) -> Ok ( b :: a :: s1, 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
joy_truthy : JoyFunction