Piso-0.2: Partial isomorphisms

Safe HaskellNone
LanguageHaskell98

Data.Piso.Common

Contents

Description

Constructor-destructor isomorphisms for some common datatypes.

Synopsis

()

unit :: Piso t (() :- t) Source #

(,)

tup :: Piso (a :- (b :- t)) ((a, b) :- t) Source #

(,,)

tup3 :: Piso (a :- (b :- (c :- t))) ((a, b, c) :- t) Source #

Maybe a

just :: Piso (a :- t) (Maybe a :- t) Source #

[a]

nil :: Piso t ([a] :- t) Source #

cons :: Piso (a :- ([a] :- t)) ([a] :- t) Source #

Either a b

left :: Piso (a :- t) (Either a b :- t) Source #

right :: Piso (b :- t) (Either a b :- t) Source #

Bool

true :: Piso t (Bool :- t) Source #