Alan & Kim Zimmerman alan.zimm at gmail.com
Sat Dec 19 13:14:51 UTC 2015

At the moment HsExpr includes the following two constructors

  | ExprWithTySig
                (LHsExpr id)
                (LHsSigWcType id)

  | ExprWithTySigOut              -- Post typechecking
                (LHsExpr id)
                (LHsSigWcType Name)  -- Retain the signature,
                                     -- as HsSigType Name, for
                                     -- round-tripping purposes

I do not understand why we need the second one, which hard-codes Name
instead of id.

There are a couple of places where there is an XXXOut variant with
hard coded Name parameter, and these complicate creating any kind of
custom class intended to work on a parameterised AST as it ripples out
and forces Name instances of it everywhere.

Perhaps we should introduce HsExprLR id id to cope with renaming?


More information about the ghc-devs mailing list