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

Safe HaskellNone



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 ( )



deriveFamily :: 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 TODO: 4. Metadada information for each of the datatypes involved

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

Generates a bunch of strings for debug purposes.