invertible-0.1.2: bidirectional arrows, bijective functions, and invariant functors

Safe HaskellSafe
LanguageHaskell2010

Data.Invertible.Either

Description

Bidirectional version of Data.Either.

Synopsis

Documentation

switch :: Either a b <-> Either b a Source #

Convert between Left and Right.

isLeft :: Either () () <-> Bool Source #

Convert between Left and True (see isLeft).

isRight :: Either () () <-> Bool Source #

Convert between Right and True (see isRight). (not . isLeft)

lft :: Either a () <-> Maybe a Source #

Convert between Left and Just.

rgt :: Either () a <-> Maybe a Source #

Convert between 'Right and Just.

eitherFirst :: Either (a, c) (b, c) <-> (Either a b, c) Source #

Lift an either out of the first component of a tuple.

eitherSecond :: Either (a, b) (a, c) <-> (a, Either b c) Source #

Lift an either out of the second component of a tuple.

pivotEither :: Either a (Either b c) <-> Either (Either a b) c Source #

Pivot nested either terms between right and left (lacking a standard 3-sum representation).