Closed upsiflu closed 1 year ago
Update Feb 7:
key
and unkey
which map between html
and (String, html)
wrapper
.Consideration
map
?
key
and unkey
, which are very common for Html
(and for tagging other types)wrap
?
Ui
, then key
before wrapping againkey
only makes sense when we have lists where things may change position, so indexedMap would be useless. Instead, we want to process a List (String, t)
into a Ui (String, html)
where the author provides a view : t->Ui html
.elm-w3
, elm-widgets
, elm-theme
, elm-ui
, elm-css
& friendsNow as everything is #16 defunctionalised, we can re-implement map
on Ui
. it would probably delete any item that has a function (the constructor currently called Stateful
which wraps html with Ui state information).
Also check out the pattern where Html gets a payload. might be a nice meeting target and could allow defunc wrapped html.
Situation
map : ( a -> b ) -> Ui a -> Ui b
because Ui can store a wrapper functiona->a
.Html.map
is [https://sporto.github.io/elm-patterns/architecture/nested-tea.html](a widely used pattern for larger SPAs where modules have their ownMsg
type), as well as for mixing Ui's made with different libraries.Possible fixes
(a) Give Ui an
inner
andouter
type(b) Defunctionalise wrapper and make it a second type parameter
(c) Do (b), then merge the two parameters