This is an alternative site for discovering Elm packages. You may be looking for the official Elm package site instead.
We were not able to find the expected elm-package.json file at this tag.
Tag 4.0.0
Committed At 2018-10-15 11:41:02 UTC



    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. Use selectedMap in view.

        view : SelectList String -> Html Msg
        view selectList =
            ul [] <|
                    (\position item ->
                        li [ onClick (Set item) ]
                            [ text <| toString <| SelectList.index item
                            , toString <| SelectList.selected item

    Get a focused item and index from select list. Position describes whether it is selected, or not.

    Compared with List.indexedMap.

        selectedMap : (Position -> SelectList a -> b) -> SelectList a -> List b
        indexedMap : (Int -> a -> b) -> List a -> List b

    Unlike indexedMap, we can get full access to all elements in the list. And set new list to Model.

    If you don't use non-empty list, use selectedMapForList that receives List instead of SelectList.

    List.indexedMap is replaced with selectedMapForList .