lue-bird/elm-linear-direction/5.1.0

NOTE: the latest version is 11.2.0

Set.Linear

transform

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

Reduce a Set in a direction.

import Linear exposing (DirectionLinear(..))
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"