lue-bird / elm-morph / Set.Morph

Morph an elm/core Set element

alter

each : MorphIndependently (comparableBeforeNarrow -> Result (Morph.ErrorWithDeadEnd deadEnd) comparableNarrow) (comparableBeforeToBroad -> comparableBroad) -> MorphIndependently (Set comparableBeforeNarrow -> Result (Morph.ErrorWithDeadEnd deadEnd) (Set comparableNarrow)) (Set comparableBeforeToBroad -> Set comparableBroad)

Morph all elements. On the narrowing side all narrowed values must be Ok for it to not result in a Morph.Error

If the given element Morph is OneToOne, each will always succeed with the type knowing it does

transform

list : MorphIndependently (List comparableNarrowElement -> Result error_ (Set comparableNarrowElement)) (Set broadElement -> List broadElement)

Morph.OneToOne from a List

import Set
import Morph

[ 0, 1, 2, 3 ]
    |> Morph.mapTo Set.Morph.list
--> Set.fromList [ 0, 1, 2, 3 ]

Inverse of List.Morph.set

value : Value.Morph.Internal.MorphValue comparableElement -> Value.Morph.Internal.MorphValue (Set comparableElement)

Set MorphValue