lue-bird/elm-morph/3.0.1

Set.Morph

MorphIndependently
( comparableBeforeNarrow
-> Result (ErrorWithDeadEnd deadEnd) comparableNarrow
)
(comparableBeforeToBroad -> comparableBroad)
-> MorphIndependently
( Set comparableBeforeNarrow
-> Result (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

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

MorphValue comparableElement
-> MorphValue (Set comparableElement)