Yet another SelectList implementation
A SelectList is a nonempty list which always has exactly one element selected. It is an example of a list zipper).
Inspired the modules
mapBy
is main function in this package.
Use mapBy
in view.
view : SelectList String -> Html Msg
view selectList =
ul [] <|
SelectList.mapBy
(\position item ->
li [ onClick (Set item) ]
[ text <| toString <| SelectList.index item
, toString <| SelectList.selected item
]
)
selectList