toastal/either/3.3.0

NOTE: this package is not compatible with Elm 0.19.1

Either.Prism

elm-monocle compatible Prisms.

leftp : Prism (Either a x) a

Prism for the Left value. Also known as _Left in other languages.

.getOption leftp (Left 1)       == Just 1
.getOption leftp (Right "fish") == Nothing
.reverseGet leftp 2             == Left 2
rightp : Prism (Either x b) b

Prism for the Right value. Also known as _Right in other languages.

.getOption rightp (Left 1)       == Nothing
.getOption rightp (Right "fish") == Just "fish"
.reverseGet rightp 2             == Right 2