úÎ:V7ª!      Safe2QREHeterogenous stack with a head and a tail. Or: an infix way to write (,).=A type class that expresses that a category is able to embed  values.PBidirectional isomorphism that is total when applied in the forward direction (a -> b8), but partial when applied in the backward direction ( b -> Maybe a).IThis can be used to express constructor-deconstructor pairs. For example: ÿ/nil :: Piso t ([a] :- t) nil = Piso f g where f t = [] :- t g ([] :- t) = Just t g _ = Nothing cons :: Piso (a :- [a] :- t) ([a] :- t) cons = Piso f g where f (x :- xs :- t) = (x : xs) :- t g ((x : xs) :- t) = Just (x :- xs :- t) g _ = NothingHere A can be read as 'cons', forming a stack of values. For example, nil pushes []A onto the stack; or, in the backward direction, tries to remove []y from the stack. Representing constructor-destructor pairs as stack manipulators allows them to be composed more easily.Module Data.Piso.Common contains Pisos for some common datatypes.Modules Data.Piso.Generic and  Data.Piso.TH! offer generic ways of deriving Pisos for custom datatypes.*Apply an isomorphism in forward direction.+Apply an isomorphism in backward direction.   55Safe 9:;DOQRT GDerive a list of partial isomorphisms, one for each constructor in the ! datatype a/. The list is wrapped in the unary constructor PisoListl. Within that constructor, the isomorphisms are separated by the right-associative binary infix constructor :&L. Finally, the individual isomorphisms are wrapped in the unary constructor Il. These constructors are all exported by this module, but no documentation is generated for them by Hackage.6As an example, here is how to define the isomorphisms nil and cons for [a], which is an instance of Generic: ¡nil :: Piso t ([a] :- t) cons :: Piso (a :- [a] :- t) ([a] :- t) (nil, cons) = (nil', cons') where PisoList (I nil' :& I cons') = mkPisoList1GHC 7.6.3 requires the extra indirection through nil' and cons', due to bug 7268 ( +http://ghc.haskell.org/trac/ghc/ticket/7268K). When it is fixed, the example above can be written in a more direct way: wnil :: Piso t ([a] :- t) cons :: Piso (a :- [a] :- t) ([a] :- t) PisoList (I nil :& I cons) = mkPisoList:If you are familiar with the generic representations from  Data.Generico, you might be interested in the exact types of the various constructors in which the isomorphisms are wrapped: ¿I :: (forall t. Piso (PisoLhs f t) (a :- t)) -> PisoList (M1 C c f) a (:&) :: PisoList f a -> PisoList g a -> PisoList (f :+: g) a PisoList :: PisoList f a -> PisoList (M1 D c f) aThe type constructor PisoLhs that appears in the type of IU is an internal type family that builds the proper heterogenous list of types (using $) based on the constructor's fields."#$%&'()*+ ,-./#'+*)  "#$%&'( ,-).*/+* NoneQRšDerive partial isomorphisms for a given datatype. The resulting expression is a tuple with one isomorphism element for each constructor in the datatype. For example: qnothing :: Piso t (Maybe a :- t) just :: Piso (a :- t) (Maybe a :- t) (nothing, just) = $(derivePisos ''Maybe)(Deriving isomorphisms this way requires -XNoMonoPatBinds.01230123NoneQR     4      !"#$%&'()*+,-./,012345678Piso-0.2-2efeK0JysKYJihXep1mJzJ Data.PisoData.Piso.Generic Data.Piso.THData.Piso.Common:-FromPisofromPisoPisoforwardbackward$fFromPisoPiso$fCategoryTYPEPiso$fEq:-$fShow:- $fFunctor:- mkPisoList $fMkPiso:*: $fMkPisoM1 $fMkPisoK1 $fMkPisoU1$fMkPisoListM1$fMkPisoList:+:$fMkPisoListM10 derivePisosunittuptup3nothingjustnilconsleftrightfalsetruebase GHC.GenericsGenericMkPisoPisoLhsmkRmkL MkPisoListPisoList mkPisoList'I:&mapHeadD:R:PisoListM1a0D:R:PisoList:+:a0D:R:PisoListM1a2 derivePisoderiveConstructorderiveDestructorconName