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

-- | Weaken applicative functor on products
--   
--   Weaken applicative functor which allows only product construction.
--   Product constructions and deconstructions are always isomorphic.
@package product-isomorphic
@version 0.0.3.3

-- | This module defines unsafe class interfaces.
module Data.Functor.ProductIsomorphic.Unsafe

-- | Define product isomorphic inference rule to specify record constructor
class ProductConstructor c
productConstructor :: ProductConstructor c => c

-- | This module defines instances of tuple types.
module Data.Functor.ProductIsomorphic.TupleInstances
instance Data.Functor.ProductIsomorphic.Unsafe.ProductConstructor (a -> b -> (a, b))
instance Data.Functor.ProductIsomorphic.Unsafe.ProductConstructor (a -> b -> c -> (a, b, c))
instance Data.Functor.ProductIsomorphic.Unsafe.ProductConstructor (a -> b -> c -> d -> (a, b, c, d))
instance Data.Functor.ProductIsomorphic.Unsafe.ProductConstructor (a -> b -> c -> d -> e -> (a, b, c, d, e))
instance Data.Functor.ProductIsomorphic.Unsafe.ProductConstructor (a -> b -> c -> d -> e -> f -> (a, b, c, d, e, f))
instance Data.Functor.ProductIsomorphic.Unsafe.ProductConstructor (a -> b -> c -> d -> e -> f -> g -> (a, b, c, d, e, f, g))
instance Data.Functor.ProductIsomorphic.Unsafe.ProductConstructor ()

-- | This module exports templates to make product constructors.
module Data.Functor.ProductIsomorphic.TH

-- | Make template of ProductConstructor instance from type constructor
--   name.
defineProductConstructor :: Name -> Q [Dec]

-- | Make template of ProductConstructor instance of tuple type.
defineTupleProductConstructor :: Int -> Q [Dec]

-- | Low-level reify interface for record type name.
reifyRecordType :: Name -> Q (((TypeQ, [Name]), ExpQ), (Maybe [Name], [TypeQ]))

-- | This module defines instances for constructors used in
--   generic-programming.
module Data.Functor.ProductIsomorphic.GenericInstances
instance Data.Functor.ProductIsomorphic.Unsafe.ProductConstructor (GHC.Generics.U1 p)
instance Data.Functor.ProductIsomorphic.Unsafe.ProductConstructor (c -> GHC.Generics.K1 i c p)
instance Data.Functor.ProductIsomorphic.Unsafe.ProductConstructor (f p -> GHC.Generics.M1 i c f p)
instance Data.Functor.ProductIsomorphic.Unsafe.ProductConstructor (f x -> g x -> (GHC.Generics.:*:) f g x)

-- | This module defines functor interfaces which morphed functions are
--   restricted to products.
module Data.Functor.ProductIsomorphic.Class

-- | Restricted functor on products.
class ProductIsoFunctor f
(|$|) :: (ProductIsoFunctor f, ProductConstructor (a -> b)) => (a -> b) -> f a -> f b
infixl 4 |$|

-- | Restricted applicative functor on products.
class ProductIsoFunctor f => ProductIsoApplicative f
pureP :: (ProductIsoApplicative f, ProductConstructor a) => a -> f a
(|*|) :: ProductIsoApplicative f => f (a -> b) -> f a -> f b
infixl 4 |*|

-- | Restricted alternative on products.
class ProductIsoApplicative f => ProductIsoAlternative f
emptyP :: ProductIsoAlternative f => f a
(|||) :: ProductIsoAlternative f => f a -> f a -> f a
infixl 3 |||

-- | Empty element of product operator
class ProductIsoApplicative f => ProductIsoEmpty f e
pureE :: ProductIsoEmpty f e => f e
peRight :: ProductIsoEmpty f e => f (a, e) -> f a
peLeft :: ProductIsoEmpty f e => f (e, a) -> f a

-- | peRight and peRightR should have isomorphic law.  peRight .
--   peRightR == peRightR . peRight == id 
peRightR :: ProductIsoEmpty f e => f a -> f (a, e)

-- | peLeft and peLeftR should have isomorphic law.  peLeft . peLeftR
--   == peLeftR . peLeft == id 
peLeftR :: ProductIsoEmpty f e => f a -> f (e, a)

-- | This module defines functor instances morphed functions are restricted
--   to products.
module Data.Functor.ProductIsomorphic.Instances

-- | Wrapped functor type to make instances of product-iso functors.
newtype WrappedFunctor f a
WrapFunctor :: f a -> WrappedFunctor f a
[unwrapFunctor] :: WrappedFunctor f a -> f a

-- | Wrapped Const Alternative objects to make instances like Const
--   functor.
newtype WrappedAlter f a b
WrapAlter :: Const (f a) b -> WrappedAlter f a b
[unWrapAlter] :: WrappedAlter f a b -> Const (f a) b
instance Data.Functor.ProductIsomorphic.Class.ProductIsoFunctor (Data.Functor.ProductIsomorphic.Instances.WrappedAlter f a)
instance GHC.Base.Alternative f => Data.Functor.ProductIsomorphic.Class.ProductIsoApplicative (Data.Functor.ProductIsomorphic.Instances.WrappedAlter f a)
instance GHC.Base.Alternative f => Data.Functor.ProductIsomorphic.Class.ProductIsoEmpty (Data.Functor.ProductIsomorphic.Instances.WrappedAlter f a) ()
instance GHC.Base.Functor f => Data.Functor.ProductIsomorphic.Class.ProductIsoFunctor (Data.Functor.ProductIsomorphic.Instances.WrappedFunctor f)
instance GHC.Base.Applicative f => Data.Functor.ProductIsomorphic.Class.ProductIsoApplicative (Data.Functor.ProductIsomorphic.Instances.WrappedFunctor f)
instance GHC.Base.Alternative f => Data.Functor.ProductIsomorphic.Class.ProductIsoAlternative (Data.Functor.ProductIsomorphic.Instances.WrappedFunctor f)
instance GHC.Base.Applicative f => Data.Functor.ProductIsomorphic.Class.ProductIsoEmpty (Data.Functor.ProductIsomorphic.Instances.WrappedFunctor f) ()
instance Data.Functor.ProductIsomorphic.Class.ProductIsoFunctor (Data.Functor.Const.Const a)
instance GHC.Base.Monoid a => Data.Functor.ProductIsomorphic.Class.ProductIsoApplicative (Data.Functor.Const.Const a)
instance GHC.Base.Monoid a => Data.Functor.ProductIsomorphic.Class.ProductIsoEmpty (Data.Functor.Const.Const a) ()

-- | This is the integrated interface module for product restricted
--   functors.
module Data.Functor.ProductIsomorphic

-- | Define product isomorphic inference rule to specify record constructor
class ProductConstructor c
