mirror of
https://github.com/roc-lang/roc.git
synced 2024-11-11 16:51:53 +03:00
17 lines
544 B
Plaintext
17 lines
544 B
Plaintext
app "form"
|
|
packages { pf: "cli-platform/main.roc" }
|
|
imports [pf.Stdin, pf.Stdout, pf.Task.{ await, Task }, pf.Program.{ Program, ExitCode }]
|
|
provides [main] to pf
|
|
|
|
main : Program
|
|
main = Program.noArgs mainTask
|
|
|
|
mainTask : Task ExitCode [] [Read [Stdin], Write [Stdout]]
|
|
mainTask =
|
|
_ <- await (Stdout.line "What's your first name?")
|
|
firstName <- await Stdin.line
|
|
_ <- await (Stdout.line "What's your last name?")
|
|
lastName <- await Stdin.line
|
|
Stdout.line "Hi, \(firstName) \(lastName)! 👋"
|
|
|> Program.exit 0
|