import std/html.{type Element, type Html} // A literal is an `Element` for any `msg`. fn para :: {

text

} //~ TYPE para: fn() -> Element fn items :: xs: List -> Html { } // Other children are shown, so they need `Show` (ADR 0034). pub fn shown_child :: n: Int -> Html {

{n}

} pub fn bad_child :: f: fn(Int) -> Int -> Html {

{f}

//~ ERROR E0401 does not implement `Show` } pub fn bad_attr :: xs: List -> Html {

x

//~^ ERROR E0602 must be a String, Int, Bool or Option } pub fn events :: -> Html { //~^ ERROR E0603 reserved for the client target } fn card :: title: String children: List> -> Element {

{title}

{children}
} pub fn uses_card :: -> Html {

body

} pub fn flag_on_component :: -> Html {

x

//~ ERROR E0604 needs a value } // `Option`: `None` leaves the attribute out (ADR 0057). pub fn option_attr :: value: Option -> Html { } pub fn bad_option_attr :: value: Option -> Html { //~ ERROR E0202 expected `String`, found `Int` } pub fn missing_component :: -> Html { //~ ERROR E0101 no value named `panel` } pub fn wrong_component_arg :: -> Html {

x

//~^ ERROR E0202 expected `String`, found `Int` }