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

Modulegenerics-sop-0.5.1.4Haskell2010

Generics.SOP.GGP

Derive generics-sop boilerplate instances from GHC's Generic.

The technique being used here is described in the following paper:

  • 5 types
  • 3 values
typetype GCode a = ToSumCode (Rep a) '[]
#

Compute the SOP code of a datatype.

This requires that Rep is defined, which in turn requires that the type has a Generic (from module GHC.Generics) instance.

This is the default definition for Generics.SOP.Code. For more info, see Generic.

typetype GFrom a = GSumFrom (Rep a)
#

Constraint for the class that computes gfrom.

typetype GTo a = GSumTo (Rep a)
#

Constraint for the class that computes gto.

valuegfrom :: (GFrom a, Generic a) => a -> SOP I (GCode a)
#

An automatically computed version of Generics.SOP.from.

This requires that the type being converted has a Generic (from module GHC.Generics) instance.

This is the default definition for Generics.SOP.from. For more info, see Generic.

valuegto :: (GTo a, Generic a) => SOP I (GCode a) -> a
#

An automatically computed version of Generics.SOP.to.

This requires that the type being converted has a Generic (from module GHC.Generics) instance.

This is the default definition for Generics.SOP.to. For more info, see Generic.

valuegdatatypeInfo :: GDatatypeInfo a => proxy a -> DatatypeInfo (GCode a)
#

An automatically computed version of Generics.SOP.datatypeInfo.

This requires that the type being converted has a Generic (from module GHC.Generics) instance.

This is the default definition for Generics.SOP.datatypeInfo. For more info, see Generics.SOP.HasDatatypeInfo.