mirror of
https://github.com/roc-lang/roc.git
synced 2024-11-11 05:34:11 +03:00
formatting
This commit is contained in:
parent
ee4c2177c0
commit
a2cb9035c4
@ -6,12 +6,16 @@ Task ok err : Effect.Effect (Result ok err)
|
||||
|
||||
forever : Task val err -> Task * err
|
||||
forever = \task ->
|
||||
looper = \{} ->
|
||||
looper = \{ } ->
|
||||
task
|
||||
|> Effect.map \res ->
|
||||
|> Effect.map
|
||||
\res ->
|
||||
when res is
|
||||
Ok _ -> Step {}
|
||||
Err e -> Done (Err e)
|
||||
Ok _ ->
|
||||
Step {}
|
||||
|
||||
Err e ->
|
||||
Done (Err e)
|
||||
|
||||
Effect.loop {} looper
|
||||
|
||||
@ -19,11 +23,17 @@ loop : state, (state -> Task [ Step state, Done done ] err) -> Task done err
|
||||
loop = \state, step ->
|
||||
looper = \current ->
|
||||
step current
|
||||
|> Effect.map \res ->
|
||||
|> Effect.map
|
||||
\res ->
|
||||
when res is
|
||||
Ok (Step newState) -> Step newState
|
||||
Ok (Done result) -> Done (Ok result)
|
||||
Err e -> Done (Err e)
|
||||
Ok (Step newState) ->
|
||||
Step newState
|
||||
|
||||
Ok (Done result) ->
|
||||
Done (Ok result)
|
||||
|
||||
Err e ->
|
||||
Done (Err e)
|
||||
|
||||
Effect.loop state looper
|
||||
|
||||
|
@ -6,12 +6,16 @@ Task ok err : Effect.Effect (Result ok err)
|
||||
|
||||
forever : Task val err -> Task * err
|
||||
forever = \task ->
|
||||
looper = \{} ->
|
||||
looper = \{ } ->
|
||||
task
|
||||
|> Effect.map \res ->
|
||||
|> Effect.map
|
||||
\res ->
|
||||
when res is
|
||||
Ok _ -> Step {}
|
||||
Err e -> Done (Err e)
|
||||
Ok _ ->
|
||||
Step {}
|
||||
|
||||
Err e ->
|
||||
Done (Err e)
|
||||
|
||||
Effect.loop {} looper
|
||||
|
||||
@ -19,11 +23,17 @@ loop : state, (state -> Task [ Step state, Done done ] err) -> Task done err
|
||||
loop = \state, step ->
|
||||
looper = \current ->
|
||||
step current
|
||||
|> Effect.map \res ->
|
||||
|> Effect.map
|
||||
\res ->
|
||||
when res is
|
||||
Ok (Step newState) -> Step newState
|
||||
Ok (Done result) -> Done (Ok result)
|
||||
Err e -> Done (Err e)
|
||||
Ok (Step newState) ->
|
||||
Step newState
|
||||
|
||||
Ok (Done result) ->
|
||||
Done (Ok result)
|
||||
|
||||
Err e ->
|
||||
Done (Err e)
|
||||
|
||||
Effect.loop state looper
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user