lue-bird/elm-linear-direction/11.1.0

NOTE: the latest version is 11.2.0

Set.Linear

Set operations that can be applied in either Direction

transform

accumulationValue
-> (element -> accumulationValue -> accumulationValue)
-> Set element
-> accumulationValue

Reduce in a Direction from a given initial accumulated thing

import Linear exposing (Direction(..))
import Set


Set.fromList [ 'i', 'l', 'a', 'g' ]
    |> Set.Linear.foldFrom "" Up String.cons
--> "liga"


Set.fromList [ 'i', 'l', 'a', 'g' ]
    |> Set.Linear.foldFrom "" Down String.cons
--> "agil"

To allow any key, try elm-keysset