
16 Dec
2007
16 Dec
'07
11:59 p.m.
On Dec 16, 2007, at 23:35 , Adam Smyczek wrote:
case name of c_a -> ... c_b -> ... I get Patterns match(es) are overlapped.
You can't use arbitrary expressions in patterns; any name (not a data constructor) used in one creates a new lambda binding (shadowing any existing binding) which receives the value at that point in the pattern. So
case name of c_a -> ...
captures the value of name in a new binding c_a. -- brandon s. allbery [solaris,freebsd,perl,pugs,haskell] allbery@kf8nh.com system administrator [openafs,heimdal,too many hats] allbery@ece.cmu.edu electrical and computer engineering, carnegie mellon university KF8NH