th-desugar v1.11 Release Notes

    • ๐Ÿ‘Œ Support GHC 8.10.
    • โž• Add support for visible dependent quantification. As part of this change, the way th-desugar represents forall and constraint types has been overhauled:

      • The existing DForallT constructor has been split into two smaller constructors:
       data DType
         = ...
      -  | DForallT [DTyVarBndr] DCxt DType
      +  | DForallT ForallVisFlag [DTyVarBndr] DType
      +  | DConstrainedT DCxt DType
         | ...
      
      +data ForallVisFlag
      +  = ForallVis
      +  | ForallInvis
      

      The previous design combined foralls and constraints into a single constructor, while the new design puts them in distinct constructors DForallT and DConstrainedT, respectively. The new DForallT constructor also has a ForallVisFlag field to distinguish invisible foralls (e.g., forall a. a) from visible foralls (e.g., forall a -> a).

      • The unravel function has been renamed to unravelDType and now returns (DFunArgs, DType), where DFunArgs is a data type that represents the possible arguments in a function type (see the Haddocks for DFunArgs for more details). There is also an unravelDType counterpart for Types named unravelType, complete with its own FunArgs data type.

      {D}FunArgs also have some supporting operations, including filter{D}VisFunArgs (to obtain only the visible arguments) and ravel{D}Type (to construct a function type using {D}FunArgs and a return {D}Type).

    • ๐Ÿ‘Œ Support standalone kind signatures by adding a DKiSigD constructor to DDec.

    • โž• Add dsReifyType, reifyTypeWithLocals_maybe, and reifyTypeWithLocals, which allow looking up the types or kinds of locally declared entities.

    • ๐Ÿ›  Fix a bug in which reifyFixityWithLocals would not look into local fixity declarations inside of type classes.

    • ๐Ÿ›  Fix a bug in which reifyFixityWithLocals would return incorrect results for classes with associated type family defaults.