exprType incorrect for let expressions which bind types
exprType function in CoreUtils doesn't handle let expressions which bind type variables correctly. Consider:
let a = Int in \ $dNum x y -> (+) a $dNum x y
exprType on this expression will give:
Num a => a -> a -> a instead of
Num Int => Int -> Int -> Int
Obviously the core lint checker does the right thing, so I modified exprType (see attached patch) to do what it does. I'm guessing that exprType isn't used in any crucial capacity (or let-bound types are not that common) or the fact that
a is unbound in the result would be a big problem. That said, we use this function heavily in HERMIT... is there another we should be using instead?
Any chance this can make the 7.8 window?