HORIZON HASKELLDocslts/ghc-9.14.x6d5fdfd2026-10-12Search packagesCtrl K
Theme: |

GHC 9.14.1 · lts/ghc-9.14.x · 6d5fdfd · 2026-10-12

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:

Synopsis
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 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.