Most generic programming libraries use a generic view to represent the structure of a datatype [Holdermans et al., 2006]. The sum of products in, for example, Extensible and Modular Generics
for the Masses [Oliveira et al., 2006] allows functions to be defined by induction on the structure. A fixed point representation such as Multirec’s [Rodriguez et al., 2009] enables access to the recursive
structure of a family (or system) of types. Defining a generic view in Haskell is closely related to constructing a universe in type theory and dependently typed programming.
A universe consists of a datatype of codes and an interpretation function that maps codes to types [Benke et al., 2003, Morris, 2007]. Functions can then be defined by induction on the codes.
At the moment we are not interested in the patch/diffing (although there are various interesting connections to p2p-consensus), but in their "universe".
They work over mutually-recursive families of types, the constructions of codes for these types is described in their paper.
The work "Type-safe diff for families of datatypes" is able to generically compute diffs for all kinds of data types.
https://www.andres-loeh.de/GDiff.html
At the moment we are not interested in the patch/diffing (although there are various interesting connections to p2p-consensus), but in their "universe".
They work over mutually-recursive families of types, the constructions of codes for these types is described in their paper.
Our friend @arianvp wrote
generics-mrsop
which is a Haskell port of Agda code, the universe descriptions can be found here https://github.com/VictorCMiraldo/stdiff/blob/master/Generic/Multirec.agdagenerics-mrsop-diff
We might want to upgrade our current universe to this one :)