generics-mrsop-2.0.0: Generic Programming with Mutually Recursive Sums of Products.

Safe HaskellNone
LanguageHaskell2010

Generics.MRSOP.TH

Description

Provides a simple way for the end-user deriving the mechanical, yet long, Element instances for a family.

We are borrowing a some code from generic-sop ( https://hackage.haskell.org/package/generics-sop-0.3.2.0/docs/src/Generics-SOP-TH.html )

Synopsis

Documentation

deriveFamilyWith :: Name -> Q Type -> Q [Dec] Source #

Given the name of the first element in the family, derives:

  1. The other types in the family and Konstant types one needs.
  2. the SOP code for each of the datatypes involved
  3. One Element instance per datatype
  4. Metadada information for each of the datatypes involved
  5. Uses the opaque-type universe provided.

genFamilyDebug :: STy -> [(STy, Int, DTI IK)] -> Q [Dec] Source #

Generates a bunch of strings for debug purposes.