Open upsiflu opened 1 year ago
Use case:
Consider ol
ol : List ( GlobalAttributes { reversed : SupportedAttribute , start : SupportedAttribute , type_list : SupportedAttribute } msg ) -> List ( Node { li : Supported } msg ) -> Node { compatible | ol : Supported } msg ol = node "ol"
and li (followingt html.spec.whatwg.org/li)
li : List ( GlobalAttributes { value_ordinal : SupportedAttribute } msg ) -> List ( Node FlowContent msg ) -> node { compatible | li : Supported } msg li = node "li"
Both are Nodes:
Node
type Node nodes msg = Node String (List (VirtualDom.Attribute msg)) (List (VirtualDom.Node msg)) | Keyed String (List (VirtualDom.Attribute msg)) (List ( String, VirtualDom.Node msg )) | Lazy (VirtualDom.Node msg) | Text String
Now, if we want to render a Ui nodes msg then there are two ways the type restrictions should kick in:
Ui nodes msg
wrap
wrap : wrapper -> Ui .. html attribute wrapper -> Ui .. html attribute wrapper
toggle (same with bounce and goTo)
bounce
goTo
List attribute -> { flag : State.Flag , isInline : Bool , label : html } -> Ui aspect html attribute wrapper -> Ui aspect html attribute wrapper
Discussion:
Perhaps it's more nuanced. If I ++ two Uis and both render some html at the same region, their constraints combine. (...)
++
html
region
Use case:
Consider ol
and li (followingt html.spec.whatwg.org/li)
Both are
Node
s:Now, if we want to render a
Ui nodes msg
then there are two ways the type restrictions should kick in:wrap
toggle (same with
bounce
andgoTo
)Discussion:
Perhaps it's more nuanced. If I
++
two Uis and both render somehtml
at the sameregion
, their constraints combine. (...)