<div dir="ltr">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).<div>
<br></div><div>[1] <a href="https://github.com/bennofs/hdevtools/blob/master/src/Info.hs#L133">https://github.com/bennofs/hdevtools/blob/master/src/Info.hs#L133</a></div></div>