Patrick Hurst | 1 Jan 06:02 2014

Get expected type of expression using GHC API?

Using the GHC API, you can get the inferred type of an `LHsExpr Id` via a `TypecheckedModule`, as hdevtools does[1]. Is there any way to get the expected type? This would be useful for cases where the expected type is much more polymorphic than the inferred type (or possibly for debugging type errors with -fdefer-type-errors, depending on what GHC does in that case).

Haskell-Cafe mailing list
Haskell-Cafe <at>