• Simon Peyton Jones's avatar
    Do pretty-printing of TyThings via IfaceDecl (Trac #7730) · b4856f9f
    Simon Peyton Jones authored
    All the initial work on this was done fy 'archblob' (fcsernik@gmail.com);
    thank you!
    
    I reviewed the patch, started some tidying, up and then ended up in a huge
    swamp of changes, not all of which I can remember now.  But:
    
    * To suppress kind arguments when we have -fno-print-explicit-kinds,
        - IfaceTyConApp argument types are in a tagged list IfaceTcArgs
    
    * To allow overloaded types to be printed with =>, add IfaceDFunTy to IfaceType.
    
    * When printing data/type family instances for the user, I've made them
      print out an informative RHS, which is a new feature. Thus
            ghci> info T
            data family T a
            data instance T Int = T1 Int Int
            data instance T Bool = T2
    
    * In implementation terms, pprIfaceDecl has just one "context" argument,
      of type IfaceSyn.ShowSub, which says
           - How to print the binders of the decl
             see note [Printing IfaceDecl binders] in IfaceSyn
           - Which sub-comoponents (eg constructors) to print
    
    * Moved FastStringEnv from RnEnv to OccName
    
    It all took a ridiculously long time to do.  But it's done!
    b4856f9f
Roles4.stderr 366 Bytes