Yet another SelectList implementation
A SelectList is a non-empty list which always has exactly one element selected. It is one of zipper.
Inspired by these modules
selectedMap is the feature function in this package.
selectedMap in view.
view : SelectList String -> Html Msg view selectList = ul  <| SelectList.selectedMap (\position item -> li [ onClick (Set item) ] [ text <| toString <| SelectList.index item , toString <| SelectList.selected item ] ) selectList
Get a focused item and index from select list.
Position describes whether it is selected, or not.
selectedMap : (Position -> SelectList a -> b) -> SelectList a -> List b indexedMap : (Int -> a -> b) -> List a -> List b
indexedMap, we can get full access to all elements in the list.
And set new list to
If you don't use non-empty list, use
selectedMapForList that receives
List instead of
List.indexedMap is replaced with