lue-bird/elm-linear-direction/11.2.0

Dict.Linear

Dict operations that can be applied in either Direction

transform

accumulationValue
-> ( { key : key
, value : value
}
-> accumulationValue
-> accumulationValue
)
-> Dict key value
-> accumulationValue

Reduce { key, value }-entries in a given Direction from a given initial accumulated thing

import Linear exposing (Direction(..))
import Dict


Dict.fromList
    [ ( "Dies", 39 ), ( "Wonu", 22 ), ( "Eorfe", 18 ) ]
    |> Dict.Linear.foldFrom [] Up (\user -> (::) user.key)
--> [ "Wonu", "Eorfe", "Dies" ]


Dict.fromList
    [ ( "Dies", 39 ), ( "Wonu", 22 ), ( "Eorfe", 18 ) ]
    |> Dict.Linear.foldFrom [] Down (\user -> (::) user.key)
--> [ "Dies", "Eorfe", "Wonu" ]

To allow any key, try elm-keysset