JsonGrammar-0.3.4: Combinators for bidirectional JSON parsing

Safe HaskellNone

Data.Iso.Common

Contents

Description

Constructor-destructor isomorphisms for some common datatypes.

Synopsis

()

unit :: Iso t (() :- t)Source

(,)

tup :: Iso (a :- (b :- t)) ((a, b) :- t)Source

(,,)

tup3 :: Iso (a :- (b :- (c :- t))) ((a, b, c) :- t)Source

Maybe a

just :: Iso (a :- t) (Maybe a :- t)Source

maybe :: Iso t (a :- t) -> Iso t (Maybe a :- t)Source

[a]

nil :: Iso t ([a] :- t)Source

cons :: Iso (a :- ([a] :- t)) ([a] :- t)Source

Either a b

left :: Iso (a :- t) (Either a b :- t)Source

right :: Iso (b :- t) (Either a b :- t)Source

either :: Iso t1 (a :- t2) -> Iso t1 (b :- t2) -> Iso t1 (Either a b :- t2)Source

Bool