mirror of
https://github.com/roc-lang/roc.git
synced 2025-09-28 14:24:45 +00:00
12 lines
439 B
Text
12 lines
439 B
Text
app "effect-example"
|
|
packages { base: "platform" }
|
|
imports [ base.Task.{ Task, after }, base.File, base.Path ]
|
|
provides [ main ] to base
|
|
|
|
main : Task.Task {} (File.FileReadErr [BadUtf8])
|
|
main =
|
|
when Path.fromStr "Cargo.toml" is
|
|
Ok path ->
|
|
Task.after (Task.putLine "Our Cargo.toml:") \_ ->
|
|
Task.after (File.readUtf8 path) (\line -> Task.putLine line)
|
|
_ -> Task.putLine "invalid path"
|