mirror of
https://github.com/roc-lang/roc.git
synced 2025-09-26 21:39:07 +00:00

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
35 lines
785 B
Text
35 lines
785 B
Text
#
|
|
# Visualizes Roc values in a basic GUI
|
|
#
|
|
app [render] { pf: platform "gui/platform/main.roc" }
|
|
|
|
import Community
|
|
import GuiFormatter
|
|
|
|
render =
|
|
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.inspect
|
|
|> GuiFormatter.toGui
|