invertible-0.1: bidirectional arrows, bijective functions, and invariant functors
Data.Invertible.Either
Description
Bidirectional version of Data.Either.
Synopsis
switch :: Either a b <-> Either b a Source
Convert between Left and Right.
Left
Right
isLeft :: Either () () <-> Bool Source
Convert between Left and True (see isLeft).
True
isLeft
isRight :: Either () () <-> Bool Source
Convert between Right and True (see isRight). (not . isLeft)
isRight
not . isLeft
not
lft :: Either a () <-> Maybe a Source
Convert between Left and Just.
Just
rgt :: Either () a <-> Maybe a Source
Convert between 'Right and Just.