HORIZON HASKELLDocslts/ghc-9.10.xc74966e2026-09-27Search names, modules, packages, or :: a typeCtrl K

GHC 9.10.3 · lts/ghc-9.10.x · c74966e · 2026-09-27

Modulebarbies-2.1.1.0Haskell2010

Barbies.Internal

  • 51 types
  • 13 classes
  • 15 values
  • Packagebarbies-2.1.1.0
  • Exports99
  • LanguageHaskell2010
  • LicenceBSD-3-Clause
  • SourceFunctorB.hs

Functor

4 declarations
classclass GFunctor (n :: Nat) (f :: k -> Type) (g :: k -> Type) (repbf :: k1 -> Type) (repbg :: k1 -> Type) where
#

Methods

  • gmap :: Proxy n -> (forall (a :: k). f a -> g a) -> repbf x -> repbg x
Instances14GFunctor, …
  • GFunctor n f g U1 U1Defined in barbies-2.1.1.0 · Barbies.Generics.Functor
  • GFunctor n f g V1 V1Defined in barbies-2.1.1.0 · Barbies.Generics.Functor
  • GFunctor n f g (Rec (P n f a') (f a)) (Rec (P n g a') (g a))Defined in barbies-2.1.1.0 · Barbies.Generics.Functor
  • GFunctor n f g (Rec x x) (Rec x x)Defined in barbies-2.1.1.0 · Barbies.Generics.Functor
  • FunctorB b => GFunctor 0 f g (Rec (b' (P 0 f)) (b f)) (Rec (b' (P 0 g)) (b g))Defined in barbies-2.1.1.0 · Barbies.Internal.FunctorB · orphan
  • FunctorT t => GFunctor 1 f g (Rec (t (P 1 f) x) (t f x)) (Rec (t (P 1 g) x) (t g x))Defined in barbies-2.1.1.0 · Barbies.Internal.FunctorT · orphan
  • Functor h => GFunctor n f g (Rec (h (P n f a')) (h (f a))) (Rec (h (P n g a')) (h (g a)))Defined in barbies-2.1.1.0 · Barbies.Generics.Functor
  • (GFunctor n f g l l', GFunctor n f g r r') => GFunctor n f g (l :*: r) (l' :*: r')Defined in barbies-2.1.1.0 · Barbies.Generics.Functor
  • (GFunctor n f g l l', GFunctor n f g r r') => GFunctor n f g (l :+: r) (l' :+: r')Defined in barbies-2.1.1.0 · Barbies.Generics.Functor
  • (Functor h, FunctorB b) => GFunctor 0 f g (Rec (h' (b' (P 0 f))) (h (b f))) (Rec (h' (b' (P 0 g))) (h (b g)))Defined in barbies-2.1.1.0 · Barbies.Internal.FunctorB · orphan
  • (Functor h, FunctorT t) => GFunctor 1 f g (Rec (h (t (P 1 f) x)) (h (t f x))) (Rec (h (t (P 1 g) x)) (h (t g x)))Defined in barbies-2.1.1.0 · Barbies.Internal.FunctorT · orphan
  • (Functor h, Functor m, FunctorB b) => GFunctor 0 f g (Rec (m' (h' (b' (P 0 f)))) (m (h (b f)))) (Rec (m' (h' (b' (P 0 g)))) (m (h (b g))))Defined in barbies-2.1.1.0 · Barbies.Internal.FunctorB · orphan
  • (Functor h, Functor m, FunctorT t) => GFunctor 1 f g (Rec (m (h (t (P 1 f) x))) (m (h (t f x)))) (Rec (m (h (t (P 1 g) x))) (m (h (t g x))))Defined in barbies-2.1.1.0 · Barbies.Internal.FunctorT · orphan
  • GFunctor n f g bf bg => GFunctor n f g (M1 i c bf) (M1 i c bg)Defined in barbies-2.1.1.0 · Barbies.Generics.Functor
typetype CanDeriveFunctorB (b :: (k -> Type) -> Type) (f :: k -> Type) (g :: k -> Type) = (GenericP 0 (b f), GenericP 0 (b g), GFunctor 0 f g (RepP 0 (b f)) (RepP 0 (b g)))
#

CanDeriveFunctorB B f g is in practice a predicate about B only. Intuitively, it says that the following holds, for any arbitrary f:

  • There is an instance of Generic (B f).

  • B f can contain fields of type b f as long as there exists a FunctorB b instance. In particular, recursive usages of B f are allowed.

  • B f can also contain usages of b f under a Functor h. For example, one could use Maybe (B f) when defining B f.

typetype CanDeriveFunctorT (t :: (k -> Type) -> k1 -> Type) (f :: k -> Type) (g :: k -> Type) (x :: k1) = (GenericP 1 (t f x), GenericP 1 (t g x), GFunctor 1 f g (RepP 1 (t f x)) (RepP 1 (t g x)))
#

CanDeriveFunctorT T f g x is in practice a predicate about T only. Intuitively, it says that the following holds, for any arbitrary f:

  • There is an instance of Generic (T f).

  • T f x can contain fields of type t f y as long as there exists a FunctorT t instance. In particular, recursive usages of T f y are allowed.

  • T f x can also contain usages of t f y under a Functor h. For example, one could use Maybe (T f y) when defining T f y.

Traversable

4 declarations
classclass GTraversable (n :: k) (f :: k1 -> Type) (g :: k1 -> Type) (repbf :: k2 -> Type) (repbg :: k2 -> Type) where
#

Methods

Instances14GTraversable, …
typetype CanDeriveTraversableB (b :: (k1 -> Type) -> Type) (f :: k1 -> Type) (g :: k1 -> Type) = (GenericP 0 (b f), GenericP 0 (b g), GTraversable 0 f g (RepP 0 (b f)) (RepP 0 (b g)))
#

CanDeriveTraversableB B f g is in practice a predicate about B only. It is analogous to CanDeriveFunctorB, so it essentially requires the following to hold, for any arbitrary f:

  • There is an instance of Generic (B f).

  • B f can contain fields of type b f as long as there exists a TraversableB b instance. In particular, recursive usages of B f are allowed.

  • B f can also contain usages of b f under a Traversable h. For example, one could use Maybe (B f) when defining B f.

typetype CanDeriveTraversableT (t :: (k1 -> Type) -> k -> Type) (f :: k1 -> Type) (g :: k1 -> Type) (x :: k) = (GenericP 1 (t f x), GenericP 1 (t g x), GTraversable 1 f g (RepP 1 (t f x)) (RepP 1 (t g x)))
#

CanDeriveTraversableT T f g x is in practice a predicate about T only. It is analogous to CanDeriveFunctorT, so it essentially requires the following to hold, for any arbitrary f:

  • There is an instance of Generic (T f x).

  • T f x can contain fields of type t f x as long as there exists a TraversableT t instance. In particular, recursive usages of T f x are allowed.

  • T f x can also contain usages of t f x under a Traversable h. For example, one could use Maybe (T f x) when defining T f x.

Distributive

4 declarations
classclass Functor f => GDistributive (n :: Nat) (f :: Type -> Type) (repbg :: k -> Type) (repbfg :: k -> Type) where
#

Methods

Instances9GDistributive, …
typetype CanDeriveDistributiveB (b :: (k1 -> Type) -> Type) (f :: Type -> Type) (g :: k1 -> Type) = (GenericP 0 (b g), GenericP 0 (b (Compose f g)), GDistributive 0 f (RepP 0 (b g)) (RepP 0 (b (Compose f g))))
#

CanDeriveDistributiveB B f g is in practice a predicate about B only. Intuitively, it says the the following holds for any arbitrary f:

  • There is an instance of Generic (B f).

  • (B f) has only one constructor, and doesn't contain "naked" fields (that is, not covered by f).

  • B f can contain fields of type b f as long as there exists a DistributiveB b instance. In particular, recursive usages of B f are allowed.

  • B f can also contain usages of b f under a Distributive h. For example, one could use a -> (B f) as a field of B f.

typetype CanDeriveDistributiveT (t :: (Type -> Type) -> i -> Type) (f :: Type -> Type) (g :: Type -> Type) (x :: i) = (GenericP 1 (t g x), GenericP 1 (t (Compose f g) x), GDistributive 1 f (RepP 1 (t g x)) (RepP 1 (t (Compose f g) x)))
#

CanDeriveDistributiveT T f g x is in practice a predicate about T only. Intuitively, it says the the following holds for any arbitrary f:

  • There is an instance of Generic (B f x).

  • (B f x) has only one constructor, and doesn't contain "naked" fields (that is, not covered by f). In particular, x needs to occur under f.

  • B f x can contain fields of type b f y as long as there exists a DistributiveT b instance. In particular, recursive usages of B f x are allowed.

  • B f x can also contain usages of b f y under a Distributive h. For example, one could use a -> (B f x) as a field of B f x.

Applicative

5 declarations
classclass GApplicative (n :: k) (f :: k2 -> Type) (g :: k2 -> Type) (repbf :: k1 -> Type) (repbg :: k1 -> Type) (repbfg :: k1 -> Type) where
#

Methods

Instances12GApplicative, …
typetype CanDeriveApplicativeB (b :: (k -> Type) -> Type) (f :: k -> Type) (g :: k -> Type) = (GenericP 0 (b f), GenericP 0 (b g), GenericP 0 (b (Product f g)), GApplicative 0 f g (RepP 0 (b f)) (RepP 0 (b g)) (RepP 0 (b (Product f g))))
#

CanDeriveApplicativeB B f g is in practice a predicate about B only. Intuitively, it says that the following holds, for any arbitrary f:

  • There is an instance of Generic (B f).

  • B has only one constructor (that is, it is not a sum-type).

  • Every field of B f is either a monoid, or of the form f a, for some type a.

typetype CanDeriveApplicativeT (t :: (k -> Type) -> k1 -> Type) (f :: k -> Type) (g :: k -> Type) (x :: k1) = (GenericP 1 (t f x), GenericP 1 (t g x), GenericP 1 (t (Product f g) x), GApplicative 1 f g (RepP 1 (t f x)) (RepP 1 (t g x)) (RepP 1 (t (Product f g) x)))
#

CanDeriveApplicativeT T f g x is in practice a predicate about T only. Intuitively, it says that the following holds, for any arbitrary f:

  • There is an instance of Generic (T f).

  • T has only one constructor (that is, it is not a sum-type).

  • Every field of T f x is either a monoid, or of the form f a, for some type a.

Constraints

16 declarations
classclass GConstraints (n :: Nat) (c :: k -> Constraint) (f :: k1) (repbx :: Type -> Type) (repbf :: k2 -> Type) (repbdf :: k2 -> Type) where
#

Methods

Instances11GConstraints, …
typetype CanDeriveConstraintsB (c :: k -> Constraint) (b :: (k -> Type) -> Type) (f :: k -> Type) = (GenericN (b f), GenericN (b (Product (Dict c) f)), AllB c b ~ GAll 0 c (GAllRepB b), GConstraints 0 c f (GAllRepB b) (RepN (b f)) (RepN (b (Product (Dict c) f))))
#

CanDeriveConstraintsB B f g is in practice a predicate about B only. Intuitively, it says that the following holds, for any arbitrary f:

  • There is an instance of Generic (B f).

  • B f can contain fields of type b f as long as there exists a ConstraintsB b instance. In particular, recursive usages of B f are allowed.

typetype CanDeriveConstraintsT (c :: k -> Constraint) (t :: (k -> Type) -> kg -> Type) (f :: k -> Type) (x :: kg) = (GenericN (t f x), GenericN (t (Product (Dict c) f) x), AllT c t ~ GAll 1 c (GAllRepT t), GConstraints 1 c f (GAllRepT t) (RepN (t f x)) (RepN (t (Product (Dict c) f) x)))
#

CanDeriveConstraintsT T f g x is in practice a predicate about T only. Intuitively, it says that the following holds, for any arbitrary f and x:

  • There is an instance of Generic (T f x).

  • T f can contain fields of type t f x as long as there exists a ConstraintsT t instance. In particular, recursive usages of T f x are allowed.

familytype family GAll (n :: Nat) (c :: k -> Constraint) (repbf :: Type -> Type) :: Constraint
#
Instances10GAll, …
  • type GAll 0 c (Other (b' (P 0 X)) (b X)) = AllB c bDefined in barbies-2.1.1.0 · Barbies.Internal.ConstraintsB · orphan
  • type GAll 0 c (Self (b' (P 0 X)) (b X)) = ()Defined in barbies-2.1.1.0 · Barbies.Internal.ConstraintsB · orphan
  • type GAll 1 c (Other (t' (P 1 X) Y) (t X Y)) = AllT c tDefined in barbies-2.1.1.0 · Barbies.Internal.ConstraintsT · orphan
  • type GAll 1 c (Self (t' (P 1 X) Y) (t X Y)) = ()Defined in barbies-2.1.1.0 · Barbies.Internal.ConstraintsT · orphan
  • type GAll n c U1 = ()Defined in barbies-2.1.1.0 · Barbies.Generics.Constraints
  • type GAll n c V1 = ()Defined in barbies-2.1.1.0 · Barbies.Generics.Constraints
  • type GAll n c (Rec l r) = GAllRec n c l rDefined in barbies-2.1.1.0 · Barbies.Generics.Constraints
  • type GAll n c (M1 i k2 repbf) = GAll n c repbfDefined in barbies-2.1.1.0 · Barbies.Generics.Constraints
  • type GAll n c (l :*: r) = (GAll n c l, GAll n c r)Defined in barbies-2.1.1.0 · Barbies.Generics.Constraints
  • type GAll n c (l :+: r) = (GAll n c l, GAll n c r)Defined in barbies-2.1.1.0 · Barbies.Generics.Constraints
typetype GAllRepT (t :: (k -> Type) -> kg -> Type) = TagSelf1 t
#

The representation used for the generic computation of the AllT c t constraints. .

datadata X (a :: k)
#
Instances9GConstraints, GAll, …
data familydata family Y :: k
#
Instances4GConstraints, GAll
datadata Self p a x
#
Instances4GConstraints, GAll
datadata Other p a x
#
Instances4GConstraints, GAll
typetype TagSelf0 (b :: (k -> Type) -> Type) = TagSelf0' (Indexed b 1) (RepN (b X))
#

We use the type-families to generically compute Barbies.AllB c b. Intuitively, if b' f' occurs inside b f, then we should just add Barbies.AllB b' c to Barbies.AllB b c. The problem is that if b is a recursive type, and b' is b, then ghc will choke and blow the stack (instead of computing a fixpoint).

So, we would like to behave differently when b = b' and add () instead of Barbies.AllB b c to break the recursion. Our trick will be to use a type family to inspect Rep (b X), for an arbitrary X, and distinguish recursive usages from non-recursive ones, tagging them with different types, so we can distinguish them in the instances.

typetype TagSelf1 (b :: (k -> Type) -> kg -> Type) = TagSelf1' (Indexed b 2) (Zip (Rep (Indexed (b X) 1 Y)) (Rep (b X Y)))
#

We use the type-families to generically compute Barbies.AllT c b. Intuitively, if t' f' x' occurs inside t f x, then we should just add Barbies.AllT t' c to Barbies.AllT t c. The problem is that if t is a recursive type, and t' is t, then ghc will choke and blow the stack (instead of computing a fixpoint).

So, we would like to behave differently when t = t' and add () instead of Barbies.AllT t c to break the recursion. Our trick will be to use a type family to inspect Rep (t X Y), for arbitrary X and Y and distinguish recursive usages from non-recursive ones, tagging them with different types, so we can distinguish them in the instances.

Bare values

4 declarations
classclass GBare (n :: Nat) (repbi :: k -> Type) (repbb :: k -> Type) where
#

Methods

Instances10GBare, …

Generic derivation support

62 declarations
newtypenewtype Rec p a (x :: k)
#

Constructors

Instances45GTraversable, GApplicative, GFunctor, GDistributive, GBare, GConstraints, …
classclass Generic a where
#

Representable types of kind *. This class is derivable in GHC with the DeriveGeneric flag on.

A Generic instance must satisfy the following laws:

from . to ≡ Prelude.id
to . from ≡ Prelude.id

Associated types

  • type family Rep a :: Type -> Type

    Generic representation type

Methods

  • from :: a -> Rep a x

    Convert from the datatype to its representation

  • to :: Rep a x -> a

    Convert from the representation to the datatype

Instances182Generic, …
  • Generic ForeignSrcLangDefined in ghc-boot-th-9.10.3 · GHC.ForeignSrcLang.Type
  • Generic ExtensionDefined in ghc-boot-th-9.10.3 · GHC.LanguageExtensions.Type
  • Generic VoidDefined in ghc-internal-9.1003.0 · GHC.Internal.Generics
  • Generic ByteOrderDefined in ghc-internal-9.1003.0 · GHC.Internal.ByteOrder
  • Generic ClosureTypeDefined in ghc-internal-9.1003.0 · GHC.Internal.ClosureTypes
  • Generic AllDefined in ghc-internal-9.1003.0 · GHC.Internal.Data.Semigroup.Internal
  • Generic AnyDefined in ghc-internal-9.1003.0 · GHC.Internal.Data.Semigroup.Internal
  • Generic VersionDefined in ghc-internal-9.1003.0 · GHC.Internal.Data.Version
  • Generic FingerprintDefined in ghc-internal-9.1003.0 · GHC.Internal.Generics
  • Generic AssociativityDefined in ghc-internal-9.1003.0 · GHC.Internal.Generics
  • Generic DecidedStrictnessDefined in ghc-internal-9.1003.0 · GHC.Internal.Generics
  • Generic FixityDefined in ghc-internal-9.1003.0 · GHC.Internal.Generics
  • Generic SourceStrictnessDefined in ghc-internal-9.1003.0 · GHC.Internal.Generics
  • Generic SourceUnpackednessDefined in ghc-internal-9.1003.0 · GHC.Internal.Generics
  • Generic ExitCodeDefined in ghc-internal-9.1003.0 · GHC.Internal.IO.Exception
  • Generic CCFlagsDefined in ghc-internal-9.1003.0 · GHC.Internal.RTS.Flags
  • Generic ConcFlagsDefined in ghc-internal-9.1003.0 · GHC.Internal.RTS.Flags
  • Generic DebugFlagsDefined in ghc-internal-9.1003.0 · GHC.Internal.RTS.Flags
  • Generic DoCostCentresDefined in ghc-internal-9.1003.0 · GHC.Internal.RTS.Flags
  • Generic DoHeapProfileDefined in ghc-internal-9.1003.0 · GHC.Internal.RTS.Flags
  • Generic DoTraceDefined in ghc-internal-9.1003.0 · GHC.Internal.RTS.Flags
  • Generic GCFlagsDefined in ghc-internal-9.1003.0 · GHC.Internal.RTS.Flags
  • Generic GiveGCStatsDefined in ghc-internal-9.1003.0 · GHC.Internal.RTS.Flags
  • Generic HpcFlagsDefined in ghc-internal-9.1003.0 · GHC.Internal.RTS.Flags
  • Generic MiscFlagsDefined in ghc-internal-9.1003.0 · GHC.Internal.RTS.Flags
  • Generic ParFlagsDefined in ghc-internal-9.1003.0 · GHC.Internal.RTS.Flags
  • Generic ProfFlagsDefined in ghc-internal-9.1003.0 · GHC.Internal.RTS.Flags
  • Generic RTSFlagsDefined in ghc-internal-9.1003.0 · GHC.Internal.RTS.Flags
  • Generic TickyFlagsDefined in ghc-internal-9.1003.0 · GHC.Internal.RTS.Flags
  • Generic TraceFlagsDefined in ghc-internal-9.1003.0 · GHC.Internal.RTS.Flags
  • Generic SrcLocDefined in ghc-internal-9.1003.0 · GHC.Internal.Generics
  • Generic GCDetailsDefined in ghc-internal-9.1003.0 · GHC.Internal.Stats
  • Generic RTSStatsDefined in ghc-internal-9.1003.0 · GHC.Internal.Stats
  • Generic GeneralCategoryDefined in ghc-internal-9.1003.0 · GHC.Internal.Generics
  • Generic BoolDefined in ghc-internal-9.1003.0 · GHC.Internal.Generics
  • Generic OrderingDefined in ghc-internal-9.1003.0 · GHC.Internal.Generics
  • Generic ModeDefined in pretty-1.1.3.6 · Text.PrettyPrint.Annotated.HughesPJ
  • Generic StyleDefined in pretty-1.1.3.6 · Text.PrettyPrint.Annotated.HughesPJ
  • Generic TextDetailsDefined in pretty-1.1.3.6 · Text.PrettyPrint.Annotated.HughesPJ
  • Generic DocDefined in pretty-1.1.3.6 · Text.PrettyPrint.HughesPJ
  • Generic AnnLookupDefined in template-haskell-2.22.0.0 · Language.Haskell.TH.Syntax
  • Generic AnnTargetDefined in template-haskell-2.22.0.0 · Language.Haskell.TH.Syntax
  • Generic BangDefined in template-haskell-2.22.0.0 · Language.Haskell.TH.Syntax
  • Generic BndrVisDefined in template-haskell-2.22.0.0 · Language.Haskell.TH.Syntax
  • Generic BodyDefined in template-haskell-2.22.0.0 · Language.Haskell.TH.Syntax
  • Generic BytesDefined in template-haskell-2.22.0.0 · Language.Haskell.TH.Syntax
  • Generic CallconvDefined in template-haskell-2.22.0.0 · Language.Haskell.TH.Syntax
  • Generic ClauseDefined in template-haskell-2.22.0.0 · Language.Haskell.TH.Syntax
  • Generic ConDefined in template-haskell-2.22.0.0 · Language.Haskell.TH.Syntax
  • Generic DecDefined in template-haskell-2.22.0.0 · Language.Haskell.TH.Syntax
  • Generic DecidedStrictnessDefined in template-haskell-2.22.0.0 · Language.Haskell.TH.Syntax
  • Generic DerivClauseDefined in template-haskell-2.22.0.0 · Language.Haskell.TH.Syntax
  • Generic DerivStrategyDefined in template-haskell-2.22.0.0 · Language.Haskell.TH.Syntax
  • Generic DocLocDefined in template-haskell-2.22.0.0 · Language.Haskell.TH.Syntax
  • Generic ExpDefined in template-haskell-2.22.0.0 · Language.Haskell.TH.Syntax
  • Generic FamilyResultSigDefined in template-haskell-2.22.0.0 · Language.Haskell.TH.Syntax
  • Generic FixityDefined in template-haskell-2.22.0.0 · Language.Haskell.TH.Syntax
  • Generic FixityDirectionDefined in template-haskell-2.22.0.0 · Language.Haskell.TH.Syntax
  • Generic ForeignDefined in template-haskell-2.22.0.0 · Language.Haskell.TH.Syntax
  • Generic FunDepDefined in template-haskell-2.22.0.0 · Language.Haskell.TH.Syntax
  • Generic GuardDefined in template-haskell-2.22.0.0 · Language.Haskell.TH.Syntax
  • Generic InfoDefined in template-haskell-2.22.0.0 · Language.Haskell.TH.Syntax
  • Generic InjectivityAnnDefined in template-haskell-2.22.0.0 · Language.Haskell.TH.Syntax
  • Generic InlineDefined in template-haskell-2.22.0.0 · Language.Haskell.TH.Syntax
  • Generic LitDefined in template-haskell-2.22.0.0 · Language.Haskell.TH.Syntax
  • Generic LocDefined in template-haskell-2.22.0.0 · Language.Haskell.TH.Syntax
  • Generic MatchDefined in template-haskell-2.22.0.0 · Language.Haskell.TH.Syntax
  • Generic ModNameDefined in template-haskell-2.22.0.0 · Language.Haskell.TH.Syntax
  • Generic ModuleDefined in template-haskell-2.22.0.0 · Language.Haskell.TH.Syntax
  • Generic ModuleInfoDefined in template-haskell-2.22.0.0 · Language.Haskell.TH.Syntax
  • Generic NameDefined in template-haskell-2.22.0.0 · Language.Haskell.TH.Syntax
  • Generic NameFlavourDefined in template-haskell-2.22.0.0 · Language.Haskell.TH.Syntax
  • Generic NameSpaceDefined in template-haskell-2.22.0.0 · Language.Haskell.TH.Syntax
  • Generic NamespaceSpecifierDefined in template-haskell-2.22.0.0 · Language.Haskell.TH.Syntax
  • Generic OccNameDefined in template-haskell-2.22.0.0 · Language.Haskell.TH.Syntax
  • Generic OverlapDefined in template-haskell-2.22.0.0 · Language.Haskell.TH.Syntax
  • Generic PatDefined in template-haskell-2.22.0.0 · Language.Haskell.TH.Syntax
  • Generic PatSynArgsDefined in template-haskell-2.22.0.0 · Language.Haskell.TH.Syntax
  • Generic PatSynDirDefined in template-haskell-2.22.0.0 · Language.Haskell.TH.Syntax
  • Generic PhasesDefined in template-haskell-2.22.0.0 · Language.Haskell.TH.Syntax
  • Generic PkgNameDefined in template-haskell-2.22.0.0 · Language.Haskell.TH.Syntax
  • Generic PragmaDefined in template-haskell-2.22.0.0 · Language.Haskell.TH.Syntax
  • Generic RangeDefined in template-haskell-2.22.0.0 · Language.Haskell.TH.Syntax
  • Generic RoleDefined in template-haskell-2.22.0.0 · Language.Haskell.TH.Syntax
  • Generic RuleBndrDefined in template-haskell-2.22.0.0 · Language.Haskell.TH.Syntax
  • Generic RuleMatchDefined in template-haskell-2.22.0.0 · Language.Haskell.TH.Syntax
  • Generic SafetyDefined in template-haskell-2.22.0.0 · Language.Haskell.TH.Syntax
  • Generic SourceStrictnessDefined in template-haskell-2.22.0.0 · Language.Haskell.TH.Syntax
  • Generic SourceUnpackednessDefined in template-haskell-2.22.0.0 · Language.Haskell.TH.Syntax
  • Generic SpecificityDefined in template-haskell-2.22.0.0 · Language.Haskell.TH.Syntax
  • Generic StmtDefined in template-haskell-2.22.0.0 · Language.Haskell.TH.Syntax
  • Generic TyLitDefined in template-haskell-2.22.0.0 · Language.Haskell.TH.Syntax
  • Generic TySynEqnDefined in template-haskell-2.22.0.0 · Language.Haskell.TH.Syntax
  • Generic TypeDefined in template-haskell-2.22.0.0 · Language.Haskell.TH.Syntax
  • Generic TypeFamilyHeadDefined in template-haskell-2.22.0.0 · Language.Haskell.TH.Syntax
  • Generic ()Defined in ghc-internal-9.1003.0 · GHC.Internal.Generics
  • Generic (Complex a)Defined in base-4.20.2.0 · Data.Complex
  • Generic (First a)Defined in base-4.20.2.0 · Data.Semigroup
  • Generic (Last a)Defined in base-4.20.2.0 · Data.Semigroup
  • Generic (Max a)Defined in base-4.20.2.0 · Data.Semigroup
  • Generic (Min a)Defined in base-4.20.2.0 · Data.Semigroup
  • Generic (WrappedMonoid m)Defined in base-4.20.2.0 · Data.Semigroup
  • Generic (NonEmpty a)Defined in ghc-internal-9.1003.0 · GHC.Internal.Generics
  • Generic (Identity a)Defined in ghc-internal-9.1003.0 · GHC.Internal.Data.Functor.Identity
  • Generic (First a)Defined in ghc-internal-9.1003.0 · GHC.Internal.Data.Monoid
  • Generic (Last a)Defined in ghc-internal-9.1003.0 · GHC.Internal.Data.Monoid
  • Generic (Down a)Defined in ghc-internal-9.1003.0 · GHC.Internal.Generics
  • Generic (Dual a)Defined in ghc-internal-9.1003.0 · GHC.Internal.Data.Semigroup.Internal
  • Generic (Endo a)Defined in ghc-internal-9.1003.0 · GHC.Internal.Data.Semigroup.Internal
  • Generic (Product a)Defined in ghc-internal-9.1003.0 · GHC.Internal.Data.Semigroup.Internal
  • Generic (Sum a)Defined in ghc-internal-9.1003.0 · GHC.Internal.Data.Semigroup.Internal
  • Generic (ZipList a)Defined in ghc-internal-9.1003.0 · GHC.Internal.Functor.ZipList
  • Generic (Par1 p)Defined in ghc-internal-9.1003.0 · GHC.Internal.Generics
  • Generic (Maybe a)Defined in ghc-internal-9.1003.0 · GHC.Internal.Generics
  • Generic (Doc a)Defined in pretty-1.1.3.6 · Text.PrettyPrint.Annotated.HughesPJ
  • Generic (TyVarBndr flag)Defined in template-haskell-2.22.0.0 · Language.Haskell.TH.Syntax
  • Generic (a)Defined in ghc-internal-9.1003.0 · GHC.Internal.Generics
  • Generic [a]Defined in ghc-internal-9.1003.0 · GHC.Internal.Generics
  • Generic (Container b a)Defined in barbies-2.1.1.0 · Barbies.Internal.Containers
  • Generic (ErrorContainer b e)Defined in barbies-2.1.1.0 · Barbies.Internal.Containers
  • Generic (Unit f)Defined in barbies-2.1.1.0 · Barbies.Internal.Trivial
  • Generic (Void f)Defined in barbies-2.1.1.0 · Barbies.Internal.Trivial
  • Generic (WrappedMonad m a)Defined in base-4.20.2.0 · Control.Applicative
  • Generic (Arg a b)Defined in base-4.20.2.0 · Data.Semigroup
  • Generic (Either a b)Defined in ghc-internal-9.1003.0 · GHC.Internal.Generics
  • Generic (Proxy t)Defined in ghc-internal-9.1003.0 · GHC.Internal.Generics
  • Generic (U1 p)Defined in ghc-internal-9.1003.0 · GHC.Internal.Generics
  • Generic (V1 p)Defined in ghc-internal-9.1003.0 · GHC.Internal.Generics
  • Generic (Lift f a)Defined in transformers-0.6.1.1 · Control.Applicative.Lift
  • Generic (MaybeT m a)Defined in transformers-0.6.1.1 · Control.Monad.Trans.Maybe
  • Generic (a, b)Defined in ghc-internal-9.1003.0 · GHC.Internal.Generics
  • Generic (WrappedArrow a b c)Defined in base-4.20.2.0 · Control.Applicative
  • Generic (Kleisli m a b)Defined in ghc-internal-9.1003.0 · GHC.Internal.Control.Arrow
  • Generic (Const a b)Defined in ghc-internal-9.1003.0 · GHC.Internal.Data.Functor.Const
  • Generic (Ap f a)Defined in ghc-internal-9.1003.0 · GHC.Internal.Data.Monoid
  • Generic (Alt f a)Defined in ghc-internal-9.1003.0 · GHC.Internal.Data.Semigroup.Internal
  • Generic (Rec1 f p)Defined in ghc-internal-9.1003.0 · GHC.Internal.Generics
  • Generic (URec Char p)Defined in ghc-internal-9.1003.0 · GHC.Internal.Generics
  • Generic (URec Double p)Defined in ghc-internal-9.1003.0 · GHC.Internal.Generics
  • Generic (URec Float p)Defined in ghc-internal-9.1003.0 · GHC.Internal.Generics
  • Generic (URec Int p)Defined in ghc-internal-9.1003.0 · GHC.Internal.Generics
  • Generic (URec Word p)Defined in ghc-internal-9.1003.0 · GHC.Internal.Generics
  • Generic (URec (Ptr ()) p)Defined in ghc-internal-9.1003.0 · GHC.Internal.Generics
  • Generic (Tagged s b)Defined in tagged-0.8.9 · Data.Tagged
  • Generic (Backwards f a)Defined in transformers-0.6.1.1 · Control.Applicative.Backwards
  • Generic (AccumT w m a)Defined in transformers-0.6.1.1 · Control.Monad.Trans.Accum
  • Generic (ExceptT e m a)Defined in transformers-0.6.1.1 · Control.Monad.Trans.Except
  • Generic (IdentityT f a)Defined in transformers-0.6.1.1 · Control.Monad.Trans.Identity
  • Generic (ReaderT r m a)Defined in transformers-0.6.1.1 · Control.Monad.Trans.Reader
  • Generic (SelectT r m a)Defined in transformers-0.6.1.1 · Control.Monad.Trans.Select
  • Generic (StateT s m a)Defined in transformers-0.6.1.1 · Control.Monad.Trans.State.Lazy
  • Generic (StateT s m a)Defined in transformers-0.6.1.1 · Control.Monad.Trans.State.Strict
  • Generic (WriterT w m a)Defined in transformers-0.6.1.1 · Control.Monad.Trans.Writer.CPS
  • Generic (WriterT w m a)Defined in transformers-0.6.1.1 · Control.Monad.Trans.Writer.Lazy
  • Generic (WriterT w m a)Defined in transformers-0.6.1.1 · Control.Monad.Trans.Writer.Strict
  • Generic (Constant a b)Defined in transformers-0.6.1.1 · Data.Functor.Constant
  • Generic (Reverse f a)Defined in transformers-0.6.1.1 · Data.Functor.Reverse
  • Generic (a, b, c)Defined in ghc-internal-9.1003.0 · GHC.Internal.Generics
  • Generic (Product f g a)Defined in base-4.20.2.0 · Data.Functor.Product
  • Generic (Sum f g a)Defined in base-4.20.2.0 · Data.Functor.Sum
  • Generic (K1 i c p)Defined in ghc-internal-9.1003.0 · GHC.Internal.Generics
  • Generic (ContT r m a)Defined in transformers-0.6.1.1 · Control.Monad.Trans.Cont
  • Generic ((:*:) f g p)Defined in ghc-internal-9.1003.0 · GHC.Internal.Generics
  • Generic ((:+:) f g p)Defined in ghc-internal-9.1003.0 · GHC.Internal.Generics
  • Generic (a, b, c, d)Defined in ghc-internal-9.1003.0 · GHC.Internal.Generics
  • Generic (Compose f g a)Defined in base-4.20.2.0 · Data.Functor.Compose
  • Generic (M1 i c f p)Defined in ghc-internal-9.1003.0 · GHC.Internal.Generics
  • Generic (RWST r w s m a)Defined in transformers-0.6.1.1 · Control.Monad.Trans.RWS.CPS
  • Generic (RWST r w s m a)Defined in transformers-0.6.1.1 · Control.Monad.Trans.RWS.Lazy
  • Generic (RWST r w s m a)Defined in transformers-0.6.1.1 · Control.Monad.Trans.RWS.Strict
  • Generic ((:.:) f g p)Defined in ghc-internal-9.1003.0 · GHC.Internal.Generics
  • Generic (a, b, c, d, e)Defined in ghc-internal-9.1003.0 · GHC.Internal.Generics
  • Generic (a, b, c, d, e, f)Defined in ghc-internal-9.1003.0 · GHC.Internal.Generics
  • Generic (a, b, c, d, e, f, g)Defined in ghc-internal-9.1003.0 · GHC.Internal.Generics
  • Generic (a, b, c, d, e, f, g, h)Defined in ghc-internal-9.1003.0 · GHC.Internal.Generics
  • Generic (a, b, c, d, e, f, g, h, i)Defined in ghc-internal-9.1003.0 · GHC.Internal.Generics
  • Generic (a, b, c, d, e, f, g, h, i, j)Defined in ghc-internal-9.1003.0 · GHC.Internal.Generics
  • Generic (a, b, c, d, e, f, g, h, i, j, k)Defined in ghc-internal-9.1003.0 · GHC.Internal.Generics
  • Generic (a, b, c, d, e, f, g, h, i, j, k, l)Defined in ghc-internal-9.1003.0 · GHC.Internal.Generics
  • Generic (a, b, c, d, e, f, g, h, i, j, k, l, m)Defined in ghc-internal-9.1003.0 · GHC.Internal.Generics
  • Generic (a, b, c, d, e, f, g, h, i, j, k, l, m, n)Defined in ghc-internal-9.1003.0 · GHC.Internal.Generics
  • Generic (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o)Defined in ghc-internal-9.1003.0 · GHC.Internal.Generics
data familydata family Param (n :: Nat) (a :: k) :: k
#
Instances43GTraversable, GApplicative, GFunctor, GDistributive, GBare, GConstraints, …
newtypenewtype K1 i c (p :: k)
#

Constants, additional parameters and recursion of kind *

Constructors

Instances24Generic1, GNFData, Bifoldable, Bifunctor, Bitraversable, Functor, …
datadata R
#

Tag for K1: recursion (of kind Type)

newtypenewtype M1 i (c :: Meta) (f :: k -> Type) (p :: k)
#

Meta-information (constructor names, etc.)

Constructors

Instances36GTraversable, GApplicative, GConstraints, GFunctor, GBare, Generic1, …
datadata (:+:) (f :: k -> Type) (g :: k -> Type) (p :: k)
#

Sums: encode choice between constructors

Constructors

Instances24GTraversable, GConstraints, GFunctor, GBare, Generic1, GNFData, …
datadata (:*:) (f :: k -> Type) (g :: k -> Type) (p :: k)
#

Products: encode multiple arguments to constructors

Constructors

  • f p :*: g pinfixr 6
Instances36GTraversable, GApplicative, GConstraints, GFunctor, GBare, Generic1, …
typetype Rec0 = K1 R
#

Type synonym for encoding recursion (of kind Type)

datadata U1 (p :: k)
#

Unit: used for constructors without arguments

Instances34GTraversable, GApplicative, GConstraints, GFunctor, GBare, Generic1, …
  • GTraversable n f g U1 U1Defined in barbies-2.1.1.0 · Barbies.Generics.Traversable
  • GApplicative n f g U1 U1 U1Defined in barbies-2.1.1.0 · Barbies.Generics.Applicative
  • GConstraints n c f U1 U1 U1Defined in barbies-2.1.1.0 · Barbies.Generics.Constraints
  • GFunctor n f g U1 U1Defined in barbies-2.1.1.0 · Barbies.Generics.Functor
  • Functor f => GDistributive n f U1 U1Defined in barbies-2.1.1.0 · Barbies.Generics.Distributive
  • GBare n U1 U1Defined in barbies-2.1.1.0 · Barbies.Generics.Bare
  • Generic1 U1Defined in ghc-internal-9.1003.0 · GHC.Internal.Generics
  • GNFData arity U1Defined in deepseq-1.5.0.0 · Control.DeepSeq
  • Monad U1Defined in ghc-internal-9.1003.0 · GHC.Internal.Generics
  • Functor U1Defined in ghc-internal-9.1003.0 · GHC.Internal.Generics
  • Applicative U1Defined in ghc-internal-9.1003.0 · GHC.Internal.Generics
  • Foldable U1Defined in ghc-internal-9.1003.0 · GHC.Internal.Data.Foldable
  • Traversable U1Defined in ghc-internal-9.1003.0 · GHC.Internal.Data.Traversable
  • Alternative U1Defined in ghc-internal-9.1003.0 · GHC.Internal.Generics
  • MonadPlus U1Defined in ghc-internal-9.1003.0 · GHC.Internal.Generics
  • MonadZip U1Defined in base-4.20.2.0 · Control.Monad.Zip
  • Eq1 U1Defined in base-orphans-0.9.3 · Data.Orphans · orphan
  • Ord1 U1Defined in base-orphans-0.9.3 · Data.Orphans · orphan
  • Read1 U1Defined in base-orphans-0.9.3 · Data.Orphans · orphan
  • Show1 U1Defined in base-orphans-0.9.3 · Data.Orphans · orphan
  • Contravariant U1Defined in base-4.20.2.0 · Data.Functor.Contravariant
  • Distributive U1Defined in distributive-0.6.2.1 · Data.Distributive
  • GDistributive U1Defined in distributive-0.6.2.1 · Data.Distributive.Generic
  • Eq (U1 p)Defined in ghc-internal-9.1003.0 · GHC.Internal.Generics
  • Data p => Data (U1 p)Defined in ghc-internal-9.1003.0 · GHC.Internal.Data.Data
  • Ord (U1 p)Defined in ghc-internal-9.1003.0 · GHC.Internal.Generics
  • Read (U1 p)Defined in ghc-internal-9.1003.0 · GHC.Internal.Generics
  • Show (U1 p)Defined in ghc-internal-9.1003.0 · GHC.Internal.Generics
  • Generic (U1 p)Defined in ghc-internal-9.1003.0 · GHC.Internal.Generics
  • Semigroup (U1 p)Defined in ghc-internal-9.1003.0 · GHC.Internal.Generics
  • Monoid (U1 p)Defined in ghc-internal-9.1003.0 · GHC.Internal.Generics
  • type Rep (U1 p) = D1 ('MetaData "U1" "GHC.Internal.Generics" "ghc-internal" 'False) (C1 ('MetaCons "U1" 'PrefixI 'False) U1)Defined in ghc-internal-9.1003.0 · GHC.Internal.Generics
  • type Rep1 U1 = D1 ('MetaData "U1" "GHC.Internal.Generics" "ghc-internal" 'False) (C1 ('MetaCons "U1" 'PrefixI 'False) U1)Defined in ghc-internal-9.1003.0 · GHC.Internal.Generics
  • type GAll n c U1 = ()Defined in barbies-2.1.1.0 · Barbies.Generics.Constraints
datadata V1 (p :: k)
#

Void: used for datatypes without constructors

Instances25GTraversable, GConstraints, GFunctor, GBare, Generic1, GNFData, …
  • GTraversable n f g V1 V1Defined in barbies-2.1.1.0 · Barbies.Generics.Traversable
  • GConstraints n c f V1 V1 V1Defined in barbies-2.1.1.0 · Barbies.Generics.Constraints
  • GFunctor n f g V1 V1Defined in barbies-2.1.1.0 · Barbies.Generics.Functor
  • GBare n V1 V1Defined in barbies-2.1.1.0 · Barbies.Generics.Bare
  • Generic1 V1Defined in ghc-internal-9.1003.0 · GHC.Internal.Generics
  • GNFData arity V1Defined in deepseq-1.5.0.0 · Control.DeepSeq
  • Functor V1Defined in ghc-internal-9.1003.0 · GHC.Internal.Generics
  • Foldable V1Defined in ghc-internal-9.1003.0 · GHC.Internal.Data.Foldable
  • Traversable V1Defined in ghc-internal-9.1003.0 · GHC.Internal.Data.Traversable
  • Foldable1 V1Defined in base-4.20.2.0 · Data.Foldable1
  • Eq1 V1Defined in base-orphans-0.9.3 · Data.Orphans · orphan
  • Ord1 V1Defined in base-orphans-0.9.3 · Data.Orphans · orphan
  • Read1 V1Defined in base-orphans-0.9.3 · Data.Orphans · orphan
  • Show1 V1Defined in base-orphans-0.9.3 · Data.Orphans · orphan
  • Contravariant V1Defined in base-4.20.2.0 · Data.Functor.Contravariant
  • Eq (V1 p)Defined in ghc-internal-9.1003.0 · GHC.Internal.Generics
  • Data p => Data (V1 p)Defined in ghc-internal-9.1003.0 · GHC.Internal.Data.Data
  • Ord (V1 p)Defined in ghc-internal-9.1003.0 · GHC.Internal.Generics
  • Read (V1 p)Defined in ghc-internal-9.1003.0 · GHC.Internal.Generics
  • Show (V1 p)Defined in ghc-internal-9.1003.0 · GHC.Internal.Generics
  • Generic (V1 p)Defined in ghc-internal-9.1003.0 · GHC.Internal.Generics
  • Semigroup (V1 p)Defined in ghc-internal-9.1003.0 · GHC.Internal.Generics
  • type Rep (V1 p) = D1 ('MetaData "V1" "GHC.Internal.Generics" "ghc-internal" 'False) V1Defined in ghc-internal-9.1003.0 · GHC.Internal.Generics
  • type Rep1 V1 = D1 ('MetaData "V1" "GHC.Internal.Generics" "ghc-internal" 'False) V1Defined in ghc-internal-9.1003.0 · GHC.Internal.Generics
  • type GAll n c V1 = ()Defined in barbies-2.1.1.0 · Barbies.Generics.Constraints
familytype family Rep a :: Type -> Type
#

Generic representation type

Instances182Rep, …
newtypenewtype (:.:) (f :: k2 -> Type) (g :: k1 -> k2) (p :: k1)
#

Composition of functors

Constructors

Instances25Generic1, GNFData, Functor, Applicative, Foldable, Traversable, …
datadata Associativity
#

Datatype to represent the associativity of a constructor

Instances16Bounded, Enum, Eq, Data, Ord, Read, …
classclass Constructor (c :: k) where
#

Class for datatypes that represent data constructors

Methods

Instances1Constructor
classclass Datatype (d :: k) where
#

Class for datatypes that represent datatypes

Methods

  • datatypeName :: t d f a -> [Char]

    The name of the datatype (unqualified)

  • moduleName :: t d f a -> [Char]

    The fully-qualified name of the module where the type is declared

  • packageName :: t d f a -> [Char]

    The package name of the module where the type is declared

  • isNewtype :: t d f a -> Bool

    Marks if the datatype is actually a newtype

Instances1Datatype
datadata DecidedStrictness
#

The strictness that GHC infers for a field during compilation. Whereas there are nine different combinations of SourceUnpackedness and SourceStrictness, the strictness that GHC decides will ultimately be one of lazy, strict, or unpacked. What GHC decides is affected both by what the user writes in the source code and by GHC flags. As an example, consider this data type:

data E = ExampleConstructor {-# UNPACK #-} !Int !Int Int
Instances16Bounded, Enum, Eq, Data, Ord, Read, …
datadata Fixity
#

Datatype to represent the fixity of a constructor. An infix | declaration directly corresponds to an application of Infix.

Instances7Eq, Data, Ord, Read, Show, Generic, …
datadata FixityI
#

This variant of Fixity appears at the type level.

Instances5SingKind, SingI, DemoteRep, Sing
  • SingKind FixityIDefined in ghc-internal-9.1003.0 · GHC.Internal.Generics
  • SingI 'PrefixIDefined in ghc-internal-9.1003.0 · GHC.Internal.Generics
  • (SingI a, KnownNat n) => SingI ('InfixI a n)Defined in ghc-internal-9.1003.0 · GHC.Internal.Generics
  • type DemoteRep FixityI = FixityDefined in ghc-internal-9.1003.0 · GHC.Internal.Generics
  • data SingDefined in ghc-internal-9.1003.0 · GHC.Internal.Generics
classclass Generic1 (f :: k -> Type) where
#

Representable types of kind * -> * (or kind k -> *, when PolyKinds is enabled). This class is derivable in GHC with the DeriveGeneric flag on.

A Generic1 instance must satisfy the following laws:

from1 . to1 ≡ Prelude.id
to1 . from1 ≡ Prelude.id

Associated types

  • type family Rep1 (f :: k -> Type) :: k -> Type

    Generic representation type

Methods

  • from1 :: f a -> Rep1 f a

    Convert from the datatype to its representation

  • to1 :: Rep1 f a -> f a

    Convert from the representation to the datatype

Instances68Generic1, …
  • Generic1 ComplexDefined in base-4.20.2.0 · Data.Complex
  • Generic1 FirstDefined in base-4.20.2.0 · Data.Semigroup
  • Generic1 LastDefined in base-4.20.2.0 · Data.Semigroup
  • Generic1 MaxDefined in base-4.20.2.0 · Data.Semigroup
  • Generic1 MinDefined in base-4.20.2.0 · Data.Semigroup
  • Generic1 WrappedMonoidDefined in base-4.20.2.0 · Data.Semigroup
  • Generic1 NonEmptyDefined in ghc-internal-9.1003.0 · GHC.Internal.Generics
  • Generic1 IdentityDefined in ghc-internal-9.1003.0 · GHC.Internal.Data.Functor.Identity
  • Generic1 FirstDefined in ghc-internal-9.1003.0 · GHC.Internal.Data.Monoid
  • Generic1 LastDefined in ghc-internal-9.1003.0 · GHC.Internal.Data.Monoid
  • Generic1 DownDefined in ghc-internal-9.1003.0 · GHC.Internal.Generics
  • Generic1 DualDefined in ghc-internal-9.1003.0 · GHC.Internal.Data.Semigroup.Internal
  • Generic1 ProductDefined in ghc-internal-9.1003.0 · GHC.Internal.Data.Semigroup.Internal
  • Generic1 SumDefined in ghc-internal-9.1003.0 · GHC.Internal.Data.Semigroup.Internal
  • Generic1 ZipListDefined in ghc-internal-9.1003.0 · GHC.Internal.Functor.ZipList
  • Generic1 Par1Defined in ghc-internal-9.1003.0 · GHC.Internal.Generics
  • Generic1 MaybeDefined in ghc-internal-9.1003.0 · GHC.Internal.Generics
  • Generic1 SoloDefined in ghc-internal-9.1003.0 · GHC.Internal.Generics
  • Generic1 []Defined in ghc-internal-9.1003.0 · GHC.Internal.Generics
  • Functor m => Generic1 (MaybeT m)Defined in transformers-0.6.1.1 · Control.Monad.Trans.Maybe
  • Generic1 ProxyDefined in ghc-internal-9.1003.0 · GHC.Internal.Generics
  • Generic1 U1Defined in ghc-internal-9.1003.0 · GHC.Internal.Generics
  • Generic1 V1Defined in ghc-internal-9.1003.0 · GHC.Internal.Generics
  • Generic1 (WrappedMonad m)Defined in base-4.20.2.0 · Control.Applicative
  • Generic1 (Arg a)Defined in base-4.20.2.0 · Data.Semigroup
  • Generic1 (Either a)Defined in ghc-internal-9.1003.0 · GHC.Internal.Generics
  • Generic1 (Tuple2 a)Defined in ghc-internal-9.1003.0 · GHC.Internal.Generics
  • Generic1 (Lift f)Defined in transformers-0.6.1.1 · Control.Applicative.Lift
  • Functor m => Generic1 (ExceptT e m)Defined in transformers-0.6.1.1 · Control.Monad.Trans.Except
  • Generic1 (WrappedArrow a b)Defined in base-4.20.2.0 · Control.Applicative
  • Generic1 (Kleisli m a)Defined in ghc-internal-9.1003.0 · GHC.Internal.Control.Arrow
  • Generic1 (Const a)Defined in ghc-internal-9.1003.0 · GHC.Internal.Data.Functor.Const
  • Generic1 (Ap f)Defined in ghc-internal-9.1003.0 · GHC.Internal.Data.Monoid
  • Generic1 (Alt f)Defined in ghc-internal-9.1003.0 · GHC.Internal.Data.Semigroup.Internal
  • Generic1 (Rec1 f)Defined in ghc-internal-9.1003.0 · GHC.Internal.Generics
  • Generic1 (URec Char)Defined in ghc-internal-9.1003.0 · GHC.Internal.Generics
  • Generic1 (URec Double)Defined in ghc-internal-9.1003.0 · GHC.Internal.Generics
  • Generic1 (URec Float)Defined in ghc-internal-9.1003.0 · GHC.Internal.Generics
  • Generic1 (URec Int)Defined in ghc-internal-9.1003.0 · GHC.Internal.Generics
  • Generic1 (URec Word)Defined in ghc-internal-9.1003.0 · GHC.Internal.Generics
  • Generic1 (URec (Ptr ()))Defined in ghc-internal-9.1003.0 · GHC.Internal.Generics
  • Generic1 (Tuple3 a b)Defined in ghc-internal-9.1003.0 · GHC.Internal.Generics
  • Generic1 (Tagged s)Defined in tagged-0.8.9 · Data.Tagged
  • Generic1 (Backwards f)Defined in transformers-0.6.1.1 · Control.Applicative.Backwards
  • Generic1 (IdentityT f)Defined in transformers-0.6.1.1 · Control.Monad.Trans.Identity
  • Generic1 (ReaderT r m)Defined in transformers-0.6.1.1 · Control.Monad.Trans.Reader
  • Generic1 (Constant a)Defined in transformers-0.6.1.1 · Data.Functor.Constant
  • Generic1 (Reverse f)Defined in transformers-0.6.1.1 · Data.Functor.Reverse
  • Generic1 (Product f g)Defined in base-4.20.2.0 · Data.Functor.Product
  • Generic1 (Sum f g)Defined in base-4.20.2.0 · Data.Functor.Sum
  • Generic1 (K1 i c)Defined in ghc-internal-9.1003.0 · GHC.Internal.Generics
  • Generic1 (Tuple4 a b c)Defined in ghc-internal-9.1003.0 · GHC.Internal.Generics
  • Generic1 (f :*: g)Defined in ghc-internal-9.1003.0 · GHC.Internal.Generics
  • Generic1 (f :+: g)Defined in ghc-internal-9.1003.0 · GHC.Internal.Generics
  • Functor f => Generic1 (Compose f g)Defined in base-4.20.2.0 · Data.Functor.Compose
  • Functor f => Generic1 (f :.: g)Defined in ghc-internal-9.1003.0 · GHC.Internal.Generics
  • Generic1 (M1 i c f)Defined in ghc-internal-9.1003.0 · GHC.Internal.Generics
  • Generic1 (Tuple5 a b c d)Defined in ghc-internal-9.1003.0 · GHC.Internal.Generics
  • Generic1 (Tuple6 a b c d e)Defined in ghc-internal-9.1003.0 · GHC.Internal.Generics
  • Generic1 (Tuple7 a b c d e f)Defined in ghc-internal-9.1003.0 · GHC.Internal.Generics
  • Generic1 (Tuple8 a b c d e f g)Defined in ghc-internal-9.1003.0 · GHC.Internal.Generics
  • Generic1 (Tuple9 a b c d e f g h)Defined in ghc-internal-9.1003.0 · GHC.Internal.Generics
  • Generic1 (Tuple10 a b c d e f g h i)Defined in ghc-internal-9.1003.0 · GHC.Internal.Generics
  • Generic1 (Tuple11 a b c d e f g h i j)Defined in ghc-internal-9.1003.0 · GHC.Internal.Generics
  • Generic1 (Tuple12 a b c d e f g h i j k)Defined in ghc-internal-9.1003.0 · GHC.Internal.Generics
  • Generic1 (Tuple13 a b c d e f g h i j k l)Defined in ghc-internal-9.1003.0 · GHC.Internal.Generics
  • Generic1 (Tuple14 a b c d e f g h i j k l m)Defined in ghc-internal-9.1003.0 · GHC.Internal.Generics
  • Generic1 (Tuple15 a b c d e f g h i j k l m n)Defined in ghc-internal-9.1003.0 · GHC.Internal.Generics
newtypenewtype Generically a
#

A datatype whose instances are defined generically, using the Generic representation. Generically1 is a higher-kinded version of Generically that uses Generic1.

Generic instances can be derived via Generically A using -XDerivingVia.

{-# LANGUAGE DeriveGeneric      #-}
{-# LANGUAGE DerivingStrategies #-}
{-# LANGUAGE DerivingVia        #-}

import GHC.Generics (Generic)

data V4 a = V4 a a a a
  deriving stock Generic

  deriving (Semigroup, Monoid)
  via Generically (V4 a)

This corresponds to Semigroup and Monoid instances defined by pointwise lifting:

instance Semigroup a => Semigroup (V4 a) where
  (<>) :: V4 a -> V4 a -> V4 a
  V4 a1 b1 c1 d1 <> V4 a2 b2 c2 d2 =
    V4 (a1 <> a2) (b1 <> b2) (c1 <> c2) (d1 <> d2)

instance Monoid a => Monoid (V4 a) where
  mempty :: V4 a
  mempty = V4 mempty mempty mempty mempty

Historically this required modifying the type class to include generic method definitions (-XDefaultSignatures) and deriving it with the anyclass strategy (-XDeriveAnyClass). Having a /via type/ like Generically decouples the instance from the type class.

Constructors

Instances2Semigroup, Monoid
newtypenewtype Generically1 (f :: k -> Type) (a :: k) where
#

A type whose instances are defined generically, using the Generic1 representation. Generically1 is a higher-kinded version of Generically that uses Generic.

Generic instances can be derived for type constructors via Generically1 F using -XDerivingVia.

{-# LANGUAGE DeriveGeneric      #-}
{-# LANGUAGE DerivingStrategies #-}
{-# LANGUAGE DerivingVia        #-}

import GHC.Generics (Generic)

data V4 a = V4 a a a a
  deriving stock (Functor, Generic1)

  deriving Applicative
  via Generically1 V4

This corresponds to Applicative instances defined by pointwise lifting:

instance Applicative V4 where
  pure :: a -> V4 a
  pure a = V4 a a a a

  liftA2 :: (a -> b -> c) -> (V4 a -> V4 b -> V4 c)
  liftA2 (·) (V4 a1 b1 c1 d1) (V4 a2 b2 c2 d2) =
    V4 (a1 · a2) (b1 · b2) (c1 · c2) (d1 · d2)

Historically this required modifying the type class to include generic method definitions (-XDefaultSignatures) and deriving it with the anyclass strategy (-XDeriveAnyClass). Having a /via type/ like Generically1 decouples the instance from the type class.

Constructors

Instances7Functor, Applicative, Alternative, Eq1, Ord1, Eq, …
datadata Meta
#

Datatype to represent metadata associated with a datatype (MetaData), constructor (MetaCons), or field selector (MetaSel).

  • In MetaData n m p nt, n is the datatype's name, m is the module in which the datatype is defined, p is the package in which the datatype is defined, and nt is 'True if the datatype is a newtype.

  • In MetaCons n f s, n is the constructor's name, f is its fixity, and s is 'True if the constructor contains record selectors.

  • In MetaSel mn su ss ds, if the field uses record syntax, then mn is Just the record name. Otherwise, mn is Nothing. su and ss are the field's unpackedness and strictness annotations, and ds is the strictness that GHC infers for the field.

Instances3Constructor, Datatype, Selector
newtypenewtype Par1 p
#

Used for marking occurrences of the parameter

Constructors

Instances26Monad, Functor, MonadFix, Applicative, Foldable, Traversable, …
newtypenewtype Rec1 (f :: k -> Type) (p :: k)
#

Recursive calls of kind * -> * (or kind k -> *, when PolyKinds is enabled)

Constructors

Instances29Generic1, GNFData, Monad, Functor, MonadFix, Applicative, …
classclass Selector (s :: k) where
#

Class for datatypes that represent records

Methods

Instances1Selector
  • (SingI mn, SingI su, SingI ss, SingI ds) => Selector ('MetaSel mn su ss ds)Defined in ghc-internal-9.1003.0 · GHC.Internal.Generics
datadata SourceStrictness
#

The strictness of a field as the user wrote it in the source code. For example, in the following data type:

data E = ExampleConstructor Int ~Int !Int

The fields of ExampleConstructor have NoSourceStrictness, SourceLazy, and SourceStrict, respectively.

Instances16Bounded, Enum, Eq, Data, Ord, Read, …
datadata SourceUnpackedness
#

The unpackedness of a field as the user wrote it in the source code. For example, in the following data type:

data E = ExampleConstructor     Int
           {-# NOUNPACK #-} Int
           {-#   UNPACK #-} Int

The fields of ExampleConstructor have NoSourceUnpackedness, SourceNoUnpack, and SourceUnpack, respectively.

Instances16Bounded, Enum, Eq, Data, Ord, Read, …
typetype UAddr = URec (Ptr ())
#

Type synonym for URec Addr#

Instances4Eq1, Ord1, Show1, Show
  • Eq1 UAddrDefined in base-orphans-0.9.3 · Data.Orphans · orphan
  • Ord1 UAddrDefined in base-orphans-0.9.3 · Data.Orphans · orphan
  • Show1 UAddrDefined in base-orphans-0.9.3 · Data.Orphans · orphan
  • Show (UAddr p)Defined in base-orphans-0.9.3 · Data.Orphans · orphan
data familydata family URec a (p :: k)
#

Constants of unlifted kinds

Instances66Generic1, GNFData, Foldable, Traversable, Functor, Eq, …
typetype UChar = URec Char
#

Type synonym for URec Char#

Instances3Eq1, Ord1, Show1
  • Eq1 UCharDefined in base-orphans-0.9.3 · Data.Orphans · orphan
  • Ord1 UCharDefined in base-orphans-0.9.3 · Data.Orphans · orphan
  • Show1 UCharDefined in base-orphans-0.9.3 · Data.Orphans · orphan
typetype UFloat = URec Float
#

Type synonym for URec Float#

Instances3Eq1, Ord1, Show1
  • Eq1 UFloatDefined in base-orphans-0.9.3 · Data.Orphans · orphan
  • Ord1 UFloatDefined in base-orphans-0.9.3 · Data.Orphans · orphan
  • Show1 UFloatDefined in base-orphans-0.9.3 · Data.Orphans · orphan
typetype UInt = URec Int
#

Type synonym for URec Int#

Instances3Eq1, Ord1, Show1
  • Eq1 UIntDefined in base-orphans-0.9.3 · Data.Orphans · orphan
  • Ord1 UIntDefined in base-orphans-0.9.3 · Data.Orphans · orphan
  • Show1 UIntDefined in base-orphans-0.9.3 · Data.Orphans · orphan
typetype UWord = URec Word
#

Type synonym for URec Word#

Instances3Eq1, Ord1, Show1
  • Eq1 UWordDefined in base-orphans-0.9.3 · Data.Orphans · orphan
  • Ord1 UWordDefined in base-orphans-0.9.3 · Data.Orphans · orphan
  • Show1 UWordDefined in base-orphans-0.9.3 · Data.Orphans · orphan
familytype family Rep1 (f :: k -> Type) :: k -> Type
#

Generic representation type

Instances68Rep1, …
typetype S1 = M1 S
#

Type synonym for encoding meta-information for record selectors

typetype C1 = M1 C
#

Type synonym for encoding meta-information for constructors

typetype D1 = M1 D
#

Type synonym for encoding meta-information for datatypes

datadata S
#

Tag for M1: record selector

datadata C
#

Tag for M1: constructor

datadata D
#

Tag for M1: datatype