patch applied (ghc): Make rebindable do-notation behave as
advertised
Simon Peyton Jones
simonpj at microsoft.com
Wed Nov 21 13:04:49 EST 2007
Wed Nov 21 09:49:14 PST 2007 simonpj at microsoft.com
* Make rebindable do-notation behave as advertised
Adopt Trac #1537. The patch ended up a bit bigger than I expected,
so I suggest we do not merge this into the 6.8 branch. But there
is no funadamental reason why not.
With this patch, rebindable do-notation really does type as if you
had written the original (>>) and (>>=) operations in desguared form.
I ended up refactoring some of the (rather complicated) error-context
stuff in TcUnify, by pushing an InstOrigin into tcSubExp and its
various calls. That means we could get rid of tcFunResTy, and the
SubCtxt type. This should improve error messages slightly
in complicated situations, because we have an Origin to hand
to instCall (in the (isSigmaTy actual_ty) case of tc_sub1).
Thanks to Pepe for the first draft of the patch.
M ./compiler/typecheck/TcBinds.lhs -2 +3
M ./compiler/typecheck/TcExpr.lhs -11 +13
M ./compiler/typecheck/TcMatches.lhs -25 +24
M ./compiler/typecheck/TcPat.lhs -1 +3
M ./compiler/typecheck/TcRnDriver.lhs -2 +1
M ./compiler/typecheck/TcRnTypes.lhs -2 +10
M ./compiler/typecheck/TcUnify.lhs -77 +50
More information about the Cvs-ghc
mailing list