[project @ 2001-06-11 12:24:51 by simonpj]
authorsimonpj <unknown>
Mon, 11 Jun 2001 12:24:53 +0000 (12:24 +0000)
committersimonpj <unknown>
Mon, 11 Jun 2001 12:24:53 +0000 (12:24 +0000)
commit2c6d73e2ca9a545c4295c6f532cd3612e7fd3d8d
tree87dd3394adb6d9a86069de667578d2013281991b
parent0004357ccaa3149cb112f5f5df1af60e65baad79
[project @ 2001-06-11 12:24:51 by simonpj]
--------------------------------------
Tidy up and improve "pattern contexts"
--------------------------------------

In various places (renamer, typechecker, desugarer) we need to know
what the context of a pattern match is (case expression, function defn,
let binding, etc).  This commit tidies up the story quite a bit.  I
think it represents a net decrease in code, and certainly it improves the
error messages from:

f x x = 3

Prevsiously we got a message like "Conflicting bindings for x in a pattern match",
but not it says "..in a defn of function f".

WARNING: the tidy up had a more global effect than I originally expected,
so it's possible that some other error messages look a bit peculiar.  They
should be easy to fix, but tell us!
26 files changed:
ghc/compiler/NOTES
ghc/compiler/deSugar/DsBinds.lhs
ghc/compiler/deSugar/DsExpr.lhs
ghc/compiler/deSugar/DsGRHSs.lhs
ghc/compiler/deSugar/DsListComp.lhs
ghc/compiler/deSugar/DsMonad.lhs
ghc/compiler/deSugar/Match.hi-boot
ghc/compiler/deSugar/Match.hi-boot-5
ghc/compiler/deSugar/Match.lhs
ghc/compiler/hsSyn/HsBinds.lhs
ghc/compiler/hsSyn/HsExpr.hi-boot
ghc/compiler/hsSyn/HsExpr.hi-boot-5
ghc/compiler/hsSyn/HsExpr.lhs
ghc/compiler/rename/RnBinds.lhs
ghc/compiler/rename/RnEnv.lhs
ghc/compiler/rename/RnExpr.lhs
ghc/compiler/rename/RnHsSyn.lhs
ghc/compiler/rename/RnSource.lhs
ghc/compiler/typecheck/TcBinds.lhs
ghc/compiler/typecheck/TcExpr.lhs
ghc/compiler/typecheck/TcGenDeriv.lhs
ghc/compiler/typecheck/TcHsSyn.lhs
ghc/compiler/typecheck/TcMatches.hi-boot
ghc/compiler/typecheck/TcMatches.hi-boot-5
ghc/compiler/typecheck/TcMatches.lhs
ghc/compiler/typecheck/TcModule.lhs