one-liner-1.0: Constraint-based generics

LicenseBSD-style (see the file LICENSE)
Maintainersjoerd@w3future.com
Stabilityexperimental
Portabilitynon-portable
Safe HaskellSafe
LanguageHaskell98

Generics.OneLiner.Classes

Description

 
Synopsis

Documentation

class (Profunctor p, GenericUnitProfunctor p, GenericProductProfunctor p) => GenericRecordProfunctor p #

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.

class (GenericRecordProfunctor p, GenericSumProfunctor p) => GenericNonEmptyProfunctor p #

A generic function using a GenericNonEmptyProfunctor works on any data type with at least one constructor.

class (GenericNonEmptyProfunctor p, GenericEmptyProfunctor p) => GenericProfunctor p #

A generic function using a GenericProfunctor works on any algebraic data type, including those with no constructors and constants.

class Profunctor p => GenericUnitProfunctor p where #

Methods

unit :: p (U1 a) (U1 a') #

Instances
Applicative f => GenericUnitProfunctor (Star f) # 
Instance details

Defined in Generics.OneLiner.Classes

Methods

unit :: Star f (U1 a) (U1 a') #

Functor f => GenericUnitProfunctor (Costar f) # 
Instance details

Defined in Generics.OneLiner.Classes

Methods

unit :: Costar f (U1 a) (U1 a') #

GenericUnitProfunctor (Tagged :: Type -> Type -> Type) # 
Instance details

Defined in Generics.OneLiner.Classes

Methods

unit :: Tagged (U1 a) (U1 a') #

Applicative f => GenericUnitProfunctor (Zip f) # 
Instance details

Defined in Generics.OneLiner.Classes

Methods

unit :: Zip f (U1 a) (U1 a') #

GenericUnitProfunctor (Ctor :: Type -> Type -> Type) # 
Instance details

Defined in Generics.OneLiner.Internal

Methods

unit :: Ctor (U1 a) (U1 a') #

GenericUnitProfunctor ((->) :: Type -> Type -> Type) # 
Instance details

Defined in Generics.OneLiner.Classes

Methods

unit :: U1 a -> U1 a' #

Applicative f => GenericUnitProfunctor (Joker f :: Type -> Type -> Type) # 
Instance details

Defined in Generics.OneLiner.Classes

Methods

unit :: Joker f (U1 a) (U1 a') #

Divisible f => GenericUnitProfunctor (Clown f :: Type -> Type -> Type) # 
Instance details

Defined in Generics.OneLiner.Classes

Methods

unit :: Clown f (U1 a) (U1 a') #

(GenericUnitProfunctor p, GenericUnitProfunctor q) => GenericUnitProfunctor (Product p q) # 
Instance details

Defined in Generics.OneLiner.Classes

Methods

unit :: Product p q (U1 a) (U1 a') #

(Applicative f, GenericUnitProfunctor p) => GenericUnitProfunctor (Tannen f p) # 
Instance details

Defined in Generics.OneLiner.Classes

Methods

unit :: Tannen f p (U1 a) (U1 a') #

(Functor f, Applicative g, Profunctor p, GenericUnitProfunctor p) => GenericUnitProfunctor (Biff p f g) # 
Instance details

Defined in Generics.OneLiner.Classes

Methods

unit :: Biff p f g (U1 a) (U1 a') #

class Profunctor p => GenericProductProfunctor p where #

Methods

mult :: p (f a) (f' a') -> p (g a) (g' a') -> p ((f :*: g) a) ((f' :*: g') a') #

Instances
Applicative f => GenericProductProfunctor (Star f) # 
Instance details

Defined in Generics.OneLiner.Classes

Methods

mult :: Star f (f0 a) (f' a') -> Star f (g a) (g' a') -> Star f ((f0 :*: g) a) ((f' :*: g') a') #

Functor f => GenericProductProfunctor (Costar f) # 
Instance details

Defined in Generics.OneLiner.Classes

Methods

mult :: Costar f (f0 a) (f' a') -> Costar f (g a) (g' a') -> Costar f ((f0 :*: g) a) ((f' :*: g') a') #

GenericProductProfunctor (Tagged :: Type -> Type -> Type) # 
Instance details

Defined in Generics.OneLiner.Classes

Methods

mult :: Tagged (f a) (f' a') -> Tagged (g a) (g' a') -> Tagged ((f :*: g) a) ((f' :*: g') a') #

Applicative f => GenericProductProfunctor (Zip f) # 
Instance details

Defined in Generics.OneLiner.Classes

Methods

mult :: Zip f (f0 a) (f' a') -> Zip f (g a) (g' a') -> Zip f ((f0 :*: g) a) ((f' :*: g') a') #

GenericProductProfunctor (Ctor :: Type -> Type -> Type) # 
Instance details

Defined in Generics.OneLiner.Internal

Methods

mult :: Ctor (f a) (f' a') -> Ctor (g a) (g' a') -> Ctor ((f :*: g) a) ((f' :*: g') a') #

GenericProductProfunctor ((->) :: Type -> Type -> Type) # 
Instance details

Defined in Generics.OneLiner.Classes

Methods

mult :: (f a -> f' a') -> (g a -> g' a') -> (f :*: g) a -> (f' :*: g') a' #

Applicative f => GenericProductProfunctor (Joker f :: Type -> Type -> Type) # 
Instance details

Defined in Generics.OneLiner.Classes

Methods

mult :: Joker f (f0 a) (f' a') -> Joker f (g a) (g' a') -> Joker f ((f0 :*: g) a) ((f' :*: g') a') #

Divisible f => GenericProductProfunctor (Clown f :: Type -> Type -> Type) # 
Instance details

Defined in Generics.OneLiner.Classes

Methods

mult :: Clown f (f0 a) (f' a') -> Clown f (g a) (g' a') -> Clown f ((f0 :*: g) a) ((f' :*: g') a') #

(GenericProductProfunctor p, GenericProductProfunctor q) => GenericProductProfunctor (Product p q) # 
Instance details

Defined in Generics.OneLiner.Classes

Methods

mult :: Product p q (f a) (f' a') -> Product p q (g a) (g' a') -> Product p q ((f :*: g) a) ((f' :*: g') a') #

(Applicative f, GenericProductProfunctor p) => GenericProductProfunctor (Tannen f p) # 
Instance details

Defined in Generics.OneLiner.Classes

Methods

mult :: Tannen f p (f0 a) (f' a') -> Tannen f p (g a) (g' a') -> Tannen f p ((f0 :*: g) a) ((f' :*: g') a') #

(Functor f, Applicative g, Profunctor p, GenericProductProfunctor p) => GenericProductProfunctor (Biff p f g) # 
Instance details

Defined in Generics.OneLiner.Classes

Methods

mult :: Biff p f g (f0 a) (f' a') -> Biff p f g (g0 a) (g' a') -> Biff p f g ((f0 :*: g0) a) ((f' :*: g') a') #

class Profunctor p => GenericSumProfunctor p where #

Methods

plus :: p (f a) (f' a') -> p (g a) (g' a') -> p ((f :+: g) a) ((f' :+: g') a') #

Instances
Applicative f => GenericSumProfunctor (Star f) # 
Instance details

Defined in Generics.OneLiner.Classes

Methods

plus :: Star f (f0 a) (f' a') -> Star f (g a) (g' a') -> Star f ((f0 :+: g) a) ((f' :+: g') a') #

Alternative f => GenericSumProfunctor (Zip f) # 
Instance details

Defined in Generics.OneLiner.Classes

Methods

plus :: Zip f (f0 a) (f' a') -> Zip f (g a) (g' a') -> Zip f ((f0 :+: g) a) ((f' :+: g') a') #

GenericSumProfunctor (Ctor :: Type -> Type -> Type) # 
Instance details

Defined in Generics.OneLiner.Internal

Methods

plus :: Ctor (f a) (f' a') -> Ctor (g a) (g' a') -> Ctor ((f :+: g) a) ((f' :+: g') a') #

GenericSumProfunctor ((->) :: Type -> Type -> Type) # 
Instance details

Defined in Generics.OneLiner.Classes

Methods

plus :: (f a -> f' a') -> (g a -> g' a') -> (f :+: g) a -> (f' :+: g') a' #

Alternative f => GenericSumProfunctor (Joker f :: Type -> Type -> Type) # 
Instance details

Defined in Generics.OneLiner.Classes

Methods

plus :: Joker f (f0 a) (f' a') -> Joker f (g a) (g' a') -> Joker f ((f0 :+: g) a) ((f' :+: g') a') #

Decidable f => GenericSumProfunctor (Clown f :: Type -> Type -> Type) # 
Instance details

Defined in Generics.OneLiner.Classes

Methods

plus :: Clown f (f0 a) (f' a') -> Clown f (g a) (g' a') -> Clown f ((f0 :+: g) a) ((f' :+: g') a') #

(GenericSumProfunctor p, GenericSumProfunctor q) => GenericSumProfunctor (Product p q) # 
Instance details

Defined in Generics.OneLiner.Classes

Methods

plus :: Product p q (f a) (f' a') -> Product p q (g a) (g' a') -> Product p q ((f :+: g) a) ((f' :+: g') a') #

(Applicative f, GenericSumProfunctor p) => GenericSumProfunctor (Tannen f p) # 
Instance details

Defined in Generics.OneLiner.Classes

Methods

plus :: Tannen f p (f0 a) (f' a') -> Tannen f p (g a) (g' a') -> Tannen f p ((f0 :+: g) a) ((f' :+: g') a') #

class Profunctor p => GenericEmptyProfunctor p where #

Methods

identity :: p a a #

zero :: p (V1 a) (V1 a') #

Instances
Applicative f => GenericEmptyProfunctor (Star f) # 
Instance details

Defined in Generics.OneLiner.Classes

Methods

identity :: Star f a a #

zero :: Star f (V1 a) (V1 a') #

Alternative f => GenericEmptyProfunctor (Zip f) # 
Instance details

Defined in Generics.OneLiner.Classes

Methods

identity :: Zip f a a #

zero :: Zip f (V1 a) (V1 a') #

GenericEmptyProfunctor (Ctor :: Type -> Type -> Type) # 
Instance details

Defined in Generics.OneLiner.Internal

Methods

identity :: Ctor a a #

zero :: Ctor (V1 a) (V1 a') #

GenericEmptyProfunctor ((->) :: Type -> Type -> Type) # 
Instance details

Defined in Generics.OneLiner.Classes

Methods

identity :: a -> a #

zero :: V1 a -> V1 a' #

Alternative f => GenericEmptyProfunctor (Joker f :: Type -> Type -> Type) # 
Instance details

Defined in Generics.OneLiner.Classes

Methods

identity :: Joker f a a #

zero :: Joker f (V1 a) (V1 a') #

Decidable f => GenericEmptyProfunctor (Clown f :: Type -> Type -> Type) # 
Instance details

Defined in Generics.OneLiner.Classes

Methods

identity :: Clown f a a #

zero :: Clown f (V1 a) (V1 a') #

(GenericEmptyProfunctor p, GenericEmptyProfunctor q) => GenericEmptyProfunctor (Product p q) # 
Instance details

Defined in Generics.OneLiner.Classes

Methods

identity :: Product p q a a #

zero :: Product p q (V1 a) (V1 a') #

(Applicative f, GenericEmptyProfunctor p) => GenericEmptyProfunctor (Tannen f p) # 
Instance details

Defined in Generics.OneLiner.Classes

Methods

identity :: Tannen f p a a #

zero :: Tannen f p (V1 a) (V1 a') #

newtype Zip f a b #

Constructors

Zip 

Fields

Instances
Functor f => Profunctor (Zip f) # 
Instance details

Defined in Generics.OneLiner.Classes

Methods

dimap :: (a -> b) -> (c -> d) -> Zip f b c -> Zip f a d #

lmap :: (a -> b) -> Zip f b c -> Zip f a c #

rmap :: (b -> c) -> Zip f a b -> Zip f a c #

(#.) :: Coercible c b => q b c -> Zip f a b -> Zip f a c #

(.#) :: Coercible b a => Zip f b c -> q a b -> Zip f a c #

Alternative f => GenericEmptyProfunctor (Zip f) # 
Instance details

Defined in Generics.OneLiner.Classes

Methods

identity :: Zip f a a #

zero :: Zip f (V1 a) (V1 a') #

Alternative f => GenericSumProfunctor (Zip f) # 
Instance details

Defined in Generics.OneLiner.Classes

Methods

plus :: Zip f (f0 a) (f' a') -> Zip f (g a) (g' a') -> Zip f ((f0 :+: g) a) ((f' :+: g') a') #

Applicative f => GenericProductProfunctor (Zip f) # 
Instance details

Defined in Generics.OneLiner.Classes

Methods

mult :: Zip f (f0 a) (f' a') -> Zip f (g a) (g' a') -> Zip f ((f0 :*: g) a) ((f' :*: g') a') #

Applicative f => GenericUnitProfunctor (Zip f) # 
Instance details

Defined in Generics.OneLiner.Classes

Methods

unit :: Zip f (U1 a) (U1 a') #

absurd :: V1 a -> b #

e1 :: (f a -> b) -> (g a -> b) -> (f :+: g) a -> b #

fst1 :: (f :*: g) a -> f a #

snd1 :: (f :*: g) a -> g a #