When a is an instance
of GHC.Generics.Generic, GHCGenerically a is an instance
of Generic.
Warnings
GHCGenerically is intended for use as a DerivingVia target.
Most other uses of its Generic instance will be quite wrong.
GHCGenerically must not be used with datatypes that have
nonlinear or linearity-polymorphic fields. Doing so will produce
completely bogus results, breaking the linearity rules.
GHCGenerically is otherwise safe to use with derived
GHC.Generics.Generic instances, which are linear. If
you choose to use it with a hand-written instance, you should
check that the underlying instance is linear.
Example
data Foo a = Bar a (Either Int a) | Baz (Maybe a) Int
deriving stock (Show, GHC.Generics.Generic)
deriving Generic via GHCGenerically (Foo a)
Constructors
Instances2Generic, Rep
Generic a => Generic (GHCGenerically a)Defined in linear-generics-0.2.3 · Generics.Linear.Unsafe.ViaGHCGenericstype Rep (GHCGenerically a) = Rep aDefined in linear-generics-0.2.3 · Generics.Linear.Unsafe.ViaGHCGenerics