andre-dietrich / elm-conditional / Conditional.Set

A collection of conditional functions for working with sets.

Build

insertIf : Basics.Bool -> comparable -> Set comparable -> Set comparable

Conditional insert

insertWhen : Maybe comparable -> Set comparable -> Set comparable

Insert an element to a Set if it is not Nothing.

removeIf : Basics.Bool -> comparable -> Set comparable -> Set comparable

Conditional remove

removeWhen : Maybe comparable -> Set comparable -> Set comparable

Remove an element to a Set if it is not Nothing.

Combine

unionIf : Basics.Bool -> Set comparable -> Set comparable -> Set comparable

Conditional union

intersectIf : Basics.Bool -> Set comparable -> Set comparable -> Set comparable

Conditional intersection

diffIf : Basics.Bool -> Set comparable -> Set comparable -> Set comparable

Conditional diff

Transform

mapIf : Basics.Bool -> (comparable -> comparable) -> Set comparable -> Set comparable

Conditional map

filterIf : Basics.Bool -> (comparable -> Basics.Bool) -> Set comparable -> Set comparable

Conditional filter