Recently I’ve been looking at purescript-generics-rep, however I struggled with knowing where the various generic constructors could appear (and at which level) and the only example I could find was for Maybe.

I wanted a way to view the type of the derived generic representation, so I could easily play around with different data types and see what they looked like. The easiest way (thanks @jusrin00) is to query the type of from :: forall rep a. Generic a rep => a -> rep, the function that converts from a data type to its generic representation, specialising a (the data type):

> import Data.Generic.Rep
> import Data.Maybe
> :t from :: forall a. Maybe a -> _
forall a
    . Maybe a
   -> Sum (Constructor "Nothing" NoArguments)
          (Constructor "Just" (Argument a0))

I initially came up with an alternative (over engineered) approach, which reports the generic type in an error message using TypeString. It’s definitely a case of “they didn’t stop to think if they should”, but you can play around with it on Try PureScript.