Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I print the value of a Task in elm-repl?

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).

like image 624
Bosh Avatar asked Aug 15 '16 15:08

Bosh


1 Answers

The Elm REPL does not yet allow for execution of Tasks. There is an open issue for this feature request.

like image 98
Chad Gilbert Avatar answered Nov 03 '22 01:11

Chad Gilbert