-- Hoogle documentation, generated by Haddock
-- See Hoogle, http://www.haskell.org/hoogle/


-- | Partial isomorphisms.
--   
--   Partial isomorphisms as described in the paper:
--   
--   Tillmann Rendel and Klaus Ostermann. Invertible Syntax Descriptions:
--   Unifying Parsing and Pretty Printing. In <i>Proc. of Haskell
--   Symposium</i>, 2010.
--   
--   The paper also describes invertible syntax descriptions as a common
--   interface for parsers and pretty printers. These are distributed
--   separately in the <i>invertible-syntax</i> package.
@package partial-isomorphisms
@version 0.2.2.1

module Control.Isomorphism.Partial.Unsafe
data Iso alpha beta
Iso :: (alpha -> Maybe beta) -> (beta -> Maybe alpha) -> Iso alpha beta

module Control.Isomorphism.Partial.TH

-- | Construct a partial isomorphism expression for a constructor, given
--   the constructor's name.
constructorIso :: Name -> ExpQ
defineIsomorphisms :: Name -> Q [Dec]

module Control.Isomorphism.Partial.Prim
data Iso alpha beta
inverse :: Iso alpha beta -> Iso beta alpha
apply :: Iso alpha beta -> alpha -> Maybe beta
unapply :: Iso alpha beta -> beta -> Maybe alpha
class IsoFunctor f
(<$>) :: IsoFunctor f => Iso alpha beta -> (f alpha -> f beta)
ignore :: alpha -> Iso alpha ()

-- | the product type constructor `(,)` is a bifunctor from <a>Iso</a>
--   $times$ <a>Iso</a> to <a>Iso</a>, so that we have the bifunctorial map
--   <a>***</a> which allows two separate isomorphisms to work on the two
--   components of a tuple.
(***) :: Iso alpha beta -> Iso gamma delta -> Iso (alpha, gamma) (beta, delta)

-- | The mediating arrow for sums constructed with <a>Either</a>. This is
--   not a proper partial isomorphism because of <a>mplus</a>.
(|||) :: Iso alpha gamma -> Iso beta gamma -> Iso (Either alpha beta) gamma

-- | Nested products associate.
associate :: Iso (alpha, (beta, gamma)) ((alpha, beta), gamma)

-- | Products commute.
commute :: Iso (alpha, beta) (beta, alpha)

-- | `()` is the unit element for products.
unit :: Iso alpha (alpha, ())

-- | `element x` is the partial isomorphism between `()` and the singleton
--   set which contains just <tt>x</tt>.
element :: Eq alpha => alpha -> Iso () alpha

-- | For a predicate <tt>p</tt>, `subset p` is the identity isomorphism
--   restricted to elements matching the predicate.
subset :: (alpha -> Bool) -> Iso alpha alpha
iterate :: Iso alpha alpha -> Iso alpha alpha

-- | Products distribute over sums.
distribute :: Iso (alpha, Either beta gamma) (Either (alpha, beta) (alpha, gamma))
instance Control.Category.Category Control.Isomorphism.Partial.Unsafe.Iso

module Control.Isomorphism.Partial.Constructors
nil :: Iso () [alpha]
cons :: Iso (alpha, [alpha]) [alpha]
listCases :: Iso (Either () (alpha, [alpha])) [alpha]
left :: forall (a_a9ix :: Type) (b_a9iy :: Type). Iso a_a9ix (Either (a_a9ix :: Type) (b_a9iy :: Type))
right :: forall (a_a9ix :: Type) (b_a9iy :: Type). Iso b_a9iy (Either (a_a9ix :: Type) (b_a9iy :: Type))
nothing :: forall (a_12 :: Type). Iso () (Maybe (a_12 :: Type))
just :: forall (a_12 :: Type). Iso a_12 (Maybe (a_12 :: Type))

module Control.Isomorphism.Partial.Derived
foldl :: Iso (alpha, beta) alpha -> Iso (alpha, [beta]) alpha

module Control.Isomorphism.Partial
