mirror of
https://github.com/roc-lang/roc.git
synced 2024-09-20 07:17:50 +03:00
Work around roc format
bug
This commit is contained in:
parent
9b8d8e85e7
commit
60bbd33f8b
@ -121,25 +121,27 @@ inspectPerson = \@Person { firstName, lastName, age, hasBeard, favoriteColor } -
|
|||||||
# This is what the auto-derive would generate.
|
# This is what the auto-derive would generate.
|
||||||
|
|
||||||
f0 <- Inspect.custom
|
f0 <- Inspect.custom
|
||||||
|
|
||||||
|
favoriteColorTag =
|
||||||
|
when favoriteColor is
|
||||||
|
Red ->
|
||||||
|
Inspect.tag "Red" []
|
||||||
|
|
||||||
|
Green ->
|
||||||
|
Inspect.tag "Green" []
|
||||||
|
|
||||||
|
Blue ->
|
||||||
|
Inspect.tag "Blue" []
|
||||||
|
|
||||||
|
RGB (r, g, b) ->
|
||||||
|
Inspect.tag "RGB" [Inspect.tuple [Inspect.u8 r, Inspect.u8 g, Inspect.u8 b]]
|
||||||
|
|
||||||
[
|
[
|
||||||
{ key: "firstName", value: Inspect.str firstName },
|
{ key: "firstName", value: Inspect.str firstName },
|
||||||
{ key: "lastName", value: Inspect.str lastName },
|
{ key: "lastName", value: Inspect.str lastName },
|
||||||
{ key: "age", value: Inspect.u8 age },
|
{ key: "age", value: Inspect.u8 age },
|
||||||
{ key: "hasBeard", value: Inspect.bool hasBeard },
|
{ key: "hasBeard", value: Inspect.bool hasBeard },
|
||||||
{
|
{ key: "favoriteColor", value: favoriteColorTag },
|
||||||
key: "favoriteColor",
|
|
||||||
value:
|
|
||||||
when favoriteColor is
|
|
||||||
Red ->
|
|
||||||
Inspect.tag "Red" []
|
|
||||||
Green ->
|
|
||||||
Inspect.tag "Green" []
|
|
||||||
Blue ->
|
|
||||||
Inspect.tag "Blue" []
|
|
||||||
RGB (r, g, b) ->
|
|
||||||
Inspect.tag "RGB" [Inspect.tuple [Inspect.u8 r, Inspect.u8 g, Inspect.u8 b]]
|
|
||||||
,
|
|
||||||
},
|
|
||||||
]
|
]
|
||||||
|> Inspect.record
|
|> Inspect.record
|
||||||
|> Inspect.apply f0
|
|> Inspect.apply f0
|
||||||
|
Loading…
Reference in New Issue
Block a user