
18 May
2011
18 May
'11
1:13 p.m.
Hi all, I'm having a problem similar to Ranjit in the mail "parsing types". However, I want to get the type of an HsExpr: getType :: HsExpr -> Type or something similar. This should basically do what :t does in ghci, but for any given HsExpr (also it should not work on Strings). Looking at the ghc sources, I found exprType :: CoreExpr -> Type which is pretty close to what i need. Another way of solving this, would be a function lik this: hsExpr2CoreExpr :: HsExpr -> CoreExpr Than I could combine them like: exprType . hsExpr2CoreExpr Any hints are very much appreciated, Sven