| License | BSD-style (see the file LICENSE) |
|---|---|
| Maintainer | sjoerd@w3future.com |
| Stability | experimental |
| Portability | non-portable |
| Safe Haskell | None |
| Language | Haskell2010 |
Generics.OneLiner.Classes
Contents
Description
Synopsis
- class (Profunctor p, GenericUnitProfunctor p, GenericProductProfunctor p) => GenericRecordProfunctor p
- class (GenericRecordProfunctor p, GenericSumProfunctor p) => GenericNonEmptyProfunctor p
- class (GenericNonEmptyProfunctor p, GenericEmptyProfunctor p) => GenericProfunctor p
- class (GenericProfunctor p, GenericConstantProfunctor p) => Generic1Profunctor p
- dimapForget :: Profunctor p => (a -> b) -> (c -> d) -> p b c -> p a d
- class Profunctor p => GenericUnitProfunctor p where
- class Profunctor p => GenericProductProfunctor p where
- class Profunctor p => GenericSumProfunctor p where
- class Profunctor p => GenericConstantProfunctor p where
- identity :: p c c
- class Profunctor p => GenericEmptyProfunctor p where
- newtype Zip f a b = Zip {
- runZip :: a -> a -> f b
- e1 :: (f a -> b) -> (g a -> b) -> (f :+: g) a -> b
- fst1 :: (f :*: g) a -> f a
- snd1 :: (f :*: g) a -> g a
Documentation
class (Profunctor p, GenericUnitProfunctor p, GenericProductProfunctor p) => GenericRecordProfunctor p Source #
A generic function using a GenericRecordProfunctor works on any data type
with exactly one constructor, a.k.a. records,
with multiple fields (mult) or no fields (unit).
GenericRecordProfunctor is similar to ProductProfuctor from the
product-profunctor package, but using types from GHC.Generics.
Instances
| (Profunctor p, GenericUnitProfunctor p, GenericProductProfunctor p) => GenericRecordProfunctor p Source # | |
Defined in Generics.OneLiner.Classes | |
class (GenericRecordProfunctor p, GenericSumProfunctor p) => GenericNonEmptyProfunctor p Source #
A generic function using a GenericNonEmptyProfunctor works on any data
type with at least one constructor.
Instances
| (GenericRecordProfunctor p, GenericSumProfunctor p) => GenericNonEmptyProfunctor p Source # | |
Defined in Generics.OneLiner.Classes | |
class (GenericNonEmptyProfunctor p, GenericEmptyProfunctor p) => GenericProfunctor p Source #
A generic function using a GenericProfunctor works on any
algebraic data type of kind Type, including those with no constructors and constants.
Instances
| (GenericNonEmptyProfunctor p, GenericEmptyProfunctor p) => GenericProfunctor p Source # | |
Defined in Generics.OneLiner.Classes | |
class (GenericProfunctor p, GenericConstantProfunctor p) => Generic1Profunctor p Source #
A generic function using a Generic1Profunctor works on any
algebraic data type of kind Type -> Type, including those with no constructors and constants.
Instances
| (GenericProfunctor p, GenericConstantProfunctor p) => Generic1Profunctor p Source # | |
Defined in Generics.OneLiner.Classes | |
dimapForget :: Profunctor p => (a -> b) -> (c -> d) -> p b c -> p a d Source #
class Profunctor p => GenericUnitProfunctor p where Source #
Instances
| Applicative f => GenericUnitProfunctor (Kleisli f) Source # | |
| GenericUnitProfunctor (Tagged :: Type -> Type -> Type) Source # | |
| Applicative f => GenericUnitProfunctor (Zip f) Source # | |
| GenericUnitProfunctor (Ctor :: Type -> Type -> Type) Source # | |
| GenericUnitProfunctor (->) Source # | |
| Applicative f => GenericUnitProfunctor (Star f) Source # | |
| Functor f => GenericUnitProfunctor (Costar f) Source # | |
| GenericUnitProfunctor (FUN 'One :: Type -> Type -> Type) Source # | |
| Applicative f => GenericUnitProfunctor (Joker f :: Type -> Type -> Type) Source # | |
| Divisible f => GenericUnitProfunctor (Clown f :: Type -> Type -> Type) Source # | |
| (GenericUnitProfunctor p, GenericUnitProfunctor q) => GenericUnitProfunctor (Product p q) Source # | |
| (Applicative f, GenericUnitProfunctor p) => GenericUnitProfunctor (Tannen f p) Source # | |
| (Functor f, Applicative g, Profunctor p, GenericUnitProfunctor p) => GenericUnitProfunctor (Biff p f g) Source # | |
class Profunctor p => GenericProductProfunctor p where Source #
Instances
| Applicative f => GenericProductProfunctor (Kleisli f) Source # | |
| GenericProductProfunctor (Tagged :: Type -> Type -> Type) Source # | |
| Applicative f => GenericProductProfunctor (Zip f) Source # | |
| GenericProductProfunctor (Ctor :: Type -> Type -> Type) Source # | |
| GenericProductProfunctor (->) Source # | |
| Applicative f => GenericProductProfunctor (Star f) Source # | |
| Functor f => GenericProductProfunctor (Costar f) Source # | |
| GenericProductProfunctor (FUN 'One :: Type -> Type -> Type) Source # | |
| Applicative f => GenericProductProfunctor (Joker f :: Type -> Type -> Type) Source # | |
| Divisible f => GenericProductProfunctor (Clown f :: Type -> Type -> Type) Source # | |
| (GenericProductProfunctor p, GenericProductProfunctor q) => GenericProductProfunctor (Product p q) Source # | |
| (Applicative f, GenericProductProfunctor p) => GenericProductProfunctor (Tannen f p) Source # | |
| (Functor f, Applicative g, Profunctor p, GenericProductProfunctor p) => GenericProductProfunctor (Biff p f g) Source # | |
class Profunctor p => GenericSumProfunctor p where Source #
Instances
| Applicative f => GenericSumProfunctor (Kleisli f) Source # | |
| Alternative f => GenericSumProfunctor (Zip f) Source # | |
| GenericSumProfunctor (Ctor :: Type -> Type -> Type) Source # | |
| GenericSumProfunctor (->) Source # | |
| Applicative f => GenericSumProfunctor (Star f) Source # | |
| GenericSumProfunctor (FUN 'One :: Type -> Type -> Type) Source # | |
| Alternative f => GenericSumProfunctor (Joker f :: Type -> Type -> Type) Source # | |
| Decidable f => GenericSumProfunctor (Clown f :: Type -> Type -> Type) Source # | |
| (GenericSumProfunctor p, GenericSumProfunctor q) => GenericSumProfunctor (Product p q) Source # | |
| (Applicative f, GenericSumProfunctor p) => GenericSumProfunctor (Tannen f p) Source # | |
class Profunctor p => GenericConstantProfunctor p where Source #
Instances
class Profunctor p => GenericEmptyProfunctor p where Source #
Instances
| Applicative f => GenericEmptyProfunctor (Kleisli f) Source # | |
| Functor f => GenericEmptyProfunctor (Zip f) Source # | |
| GenericEmptyProfunctor (Ctor :: Type -> Type -> Type) Source # | |
| GenericEmptyProfunctor (->) Source # | |
| Functor f => GenericEmptyProfunctor (Star f) Source # | |
| GenericEmptyProfunctor (FUN 'One :: Type -> Type -> Type) Source # | |
| Alternative f => GenericEmptyProfunctor (Joker f :: Type -> Type -> Type) Source # | |
| Decidable f => GenericEmptyProfunctor (Clown f :: Type -> Type -> Type) Source # | |
| (GenericEmptyProfunctor p, GenericEmptyProfunctor q) => GenericEmptyProfunctor (Product p q) Source # | |
| (Applicative f, GenericEmptyProfunctor p) => GenericEmptyProfunctor (Tannen f p) Source # | |
Instances
| Functor f => Profunctor (Zip f) Source # | |
| Functor f => GenericEmptyProfunctor (Zip f) Source # | |
| Alternative f => GenericConstantProfunctor (Zip f) Source # | |
Defined in Generics.OneLiner.Classes | |
| Alternative f => GenericSumProfunctor (Zip f) Source # | |
| Applicative f => GenericProductProfunctor (Zip f) Source # | |
| Applicative f => GenericUnitProfunctor (Zip f) Source # | |
Orphan instances
| Profunctor (Tagged :: Type -> Type -> Type) Source # | |
| Functor f => Profunctor (Star f) Source # | |
| Functor f => Profunctor (Costar f) Source # | |
| Profunctor (FUN 'One :: Type -> Type -> Type) Source # | |
| Functor f => Profunctor (Joker f :: Type -> Type -> Type) Source # | |
| Contravariant f => Profunctor (Clown f :: Type -> Type -> Type) Source # | |
| (Profunctor p, Profunctor q) => Profunctor (Product p q) Source # | |
| (Applicative f, Profunctor p) => Profunctor (Tannen f p) Source # | |
| (Functor f, Applicative g, Profunctor p) => Profunctor (Biff p f g) Source # | |