lue-bird/elm-linear-direction/6.0.1

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

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"