Copyright | 2017 Kei Hibino |
---|---|
License | BSD3 |
Maintainer | ex8k.hibino@gmail.com |
Stability | experimental |
Portability | unknown |
Safe Haskell | Safe-Inferred |
Language | Haskell2010 |
This module defines functor interfaces which morphed functions are restricted to products.
Synopsis
- class ProductIsoFunctor f where
- (|$|) :: ProductConstructor (a -> b) => (a -> b) -> f a -> f b
- class ProductIsoFunctor f => ProductIsoApplicative f where
- pureP :: ProductConstructor a => a -> f a
- (|*|) :: f (a -> b) -> f a -> f b
- class ProductIsoApplicative f => ProductIsoAlternative f where
- class ProductIsoApplicative f => ProductIsoEmpty f e where
- peRightR :: ProductIsoEmpty f e => f a -> f (a, e)
- peLeftR :: ProductIsoEmpty f e => f a -> f (e, a)
ProductIso classes
class ProductIsoFunctor f where Source #
Restricted functor on products.
(|$|) :: ProductConstructor (a -> b) => (a -> b) -> f a -> f b infixl 4 Source #
Instances
Functor f => ProductIsoFunctor (WrappedFunctor f) Source # | |
Defined in Data.Functor.ProductIsomorphic.Instances (|$|) :: ProductConstructor (a -> b) => (a -> b) -> WrappedFunctor f a -> WrappedFunctor f b Source # | |
ProductIsoFunctor (Const a :: Type -> Type) Source # | |
Defined in Data.Functor.ProductIsomorphic.Instances | |
ProductIsoFunctor (WrappedAlter f a) Source # | |
Defined in Data.Functor.ProductIsomorphic.Instances (|$|) :: ProductConstructor (a0 -> b) => (a0 -> b) -> WrappedAlter f a a0 -> WrappedAlter f a b Source # |
class ProductIsoFunctor f => ProductIsoApplicative f where Source #
Restricted applicative functor on products.
pureP :: ProductConstructor a => a -> f a Source #
Instances
Applicative f => ProductIsoApplicative (WrappedFunctor f) Source # | |
Defined in Data.Functor.ProductIsomorphic.Instances pureP :: ProductConstructor a => a -> WrappedFunctor f a Source # (|*|) :: WrappedFunctor f (a -> b) -> WrappedFunctor f a -> WrappedFunctor f b Source # | |
Monoid a => ProductIsoApplicative (Const a :: Type -> Type) Source # | |
Alternative f => ProductIsoApplicative (WrappedAlter f a) Source # | |
Defined in Data.Functor.ProductIsomorphic.Instances pureP :: ProductConstructor a0 => a0 -> WrappedAlter f a a0 Source # (|*|) :: WrappedAlter f a (a0 -> b) -> WrappedAlter f a a0 -> WrappedAlter f a b Source # |
class ProductIsoApplicative f => ProductIsoAlternative f where Source #
Restricted alternative on products.
Instances
Alternative f => ProductIsoAlternative (WrappedFunctor f) Source # | |
Defined in Data.Functor.ProductIsomorphic.Instances emptyP :: WrappedFunctor f a Source # (|||) :: WrappedFunctor f a -> WrappedFunctor f a -> WrappedFunctor f a Source # |
Empty element
class ProductIsoApplicative f => ProductIsoEmpty f e where Source #
Empty element of product operator
Instances
Applicative f => ProductIsoEmpty (WrappedFunctor f) () Source # | |
Defined in Data.Functor.ProductIsomorphic.Instances pureE :: WrappedFunctor f () Source # peRight :: WrappedFunctor f (a, ()) -> WrappedFunctor f a Source # peLeft :: WrappedFunctor f ((), a) -> WrappedFunctor f a Source # | |
Monoid a => ProductIsoEmpty (Const a :: Type -> Type) () Source # | |
Alternative f => ProductIsoEmpty (WrappedAlter f a) () Source # | |
Defined in Data.Functor.ProductIsomorphic.Instances pureE :: WrappedAlter f a () Source # peRight :: WrappedAlter f a (a0, ()) -> WrappedAlter f a a0 Source # peLeft :: WrappedAlter f a ((), a0) -> WrappedAlter f a a0 Source # |
peRightR :: ProductIsoEmpty f e => f a -> f (a, e) Source #
peRight and peRightR should have isomorphic law.
peRight . peRightR == peRightR . peRight == id
peLeftR :: ProductIsoEmpty f e => f a -> f (e, a) Source #
peLeft and peLeftR should have isomorphic law.
peLeft . peLeftR == peLeftR . peLeft == id