Simon Peyton Jones
simonpj at microsoft.com
Mon Dec 21 08:46:58 UTC 2015
Yes this is annoying.
The thing is that with the first constructor only we'd get
after type checking, but we don't have such a thing. `HsTypes` are typechecked to `Types`.
Perhaps we could have
(LHsSigWcType (StopAtRenamer d))
type family StopAtRenamer a where
StopAtRenamer Id = Name
StopAtRenamer x = x
If this pattern happened a lot it might be worth it. But I think this is the only occurrence.
Better ideas welcome.
| -----Original Message-----
| From: ghc-devs [mailto:ghc-devs-bounces at haskell.org] On Behalf Of Alan
| & Kim Zimmerman
| Sent: 19 December 2015 13:15
| To: ghc-devs at haskell.org
| Subject: ExprWithTySigOut
| 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?
| ghc-devs mailing list
| ghc-devs at haskell.org
More information about the ghc-devs