Let's say I've created a simple task in elm-repl
, like:
> forty = Task.succeed 40
<task> : Task.Task a number
How do I take my forty
and... use it? I can convert the Task
into a Cmd
via:
> Task.perform (\x -> Nothing) (\a -> Just a) forty
{ type = "leaf", home = "Task", value = T <task> }
: Platform.Cmd.Cmd (Maybe.Maybe Float)
... but I'm not sure if this takes me closer to my goal, since I don't know how to "force" the command (e.g. to print out its value to the screen).
The Elm REPL does not yet allow for execution of Tasks. There is an open issue for this feature request.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With