mirror of
https://github.com/roc-lang/roc.git
synced 2024-11-11 05:34:11 +03:00
update cli example
This commit is contained in:
parent
db2d437d78
commit
6f9550d792
@ -4,11 +4,7 @@ platform "examples/cli"
|
||||
packages {}
|
||||
imports [ Task.{ Task } ]
|
||||
provides [ mainForHost ]
|
||||
effects fx.Effect
|
||||
{
|
||||
putLine : Str -> Effect {},
|
||||
getLine : Effect Str
|
||||
}
|
||||
effects fx.Unused {}
|
||||
|
||||
mainForHost : Task {} [] as Fx
|
||||
mainForHost = main
|
||||
|
@ -1,6 +1,6 @@
|
||||
interface Stdin
|
||||
exposes [ line ]
|
||||
imports [ fx.Effect, Task ]
|
||||
imports [ pf.Effect, Task ]
|
||||
|
||||
line : Task.Task Str *
|
||||
line = Effect.after Effect.getLine Task.succeed# TODO FIXME Effect.getLine should suffice
|
||||
|
@ -1,6 +1,6 @@
|
||||
interface Stdout
|
||||
exposes [ line ]
|
||||
imports [ fx.Effect, Task.{ Task } ]
|
||||
imports [ pf.Effect, Task.{ Task } ]
|
||||
|
||||
# line : Str -> Task.Task {} *
|
||||
# line = \line -> Effect.map (Effect.putLine line) (\_ -> Ok {})
|
||||
|
@ -1,6 +1,6 @@
|
||||
interface Task
|
||||
exposes [ Task, succeed, fail, await, map, onFail, attempt, forever, loop ]
|
||||
imports [ fx.Effect ]
|
||||
imports [ pf.Effect ]
|
||||
|
||||
Task ok err : Effect.Effect (Result ok err)
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user