roc/examples/inspect-logging.roc
Agus Zubiaga 8dedd9f03c
New app header syntax
Implements the new app header syntax as discussed in Zulip [1].

    app [main] {
	cli: platform "../platform/main.roc",
	json: "../json/main.roc"
    }

Old headers still parse and are automatically upgraded to the new
syntax by the formatter.

[1] 418444862
2024-05-01 10:49:01 -03:00

36 lines
975 B
Text

#
# Shows how Roc values can be logged
#
app [main] { pf: platform "https://github.com/roc-lang/basic-cli/releases/download/0.10.0/vNe6s9hWzoTZtFmNkvEICPErI9ptji_ySjicO6CkucY.tar.br" }
import pf.Stdout
import pf.Task
import Community
main =
Community.empty
|> Community.addPerson {
firstName: "John",
lastName: "Smith",
age: 27,
hasBeard: Bool.true,
favoriteColor: Blue,
}
|> Community.addPerson {
firstName: "Debby",
lastName: "Johnson",
age: 47,
hasBeard: Bool.false,
favoriteColor: Green,
}
|> Community.addPerson {
firstName: "Jane",
lastName: "Doe",
age: 33,
hasBeard: Bool.false,
favoriteColor: RGB (255, 255, 0),
}
|> Community.addFriend 0 2
|> Community.addFriend 1 2
|> Inspect.toStr
|> Stdout.line!