
On Sat, Apr 14, 2007 at 03:43:03AM +0200, Twan van Laarhoven wrote:
In the interest of removing things from the standard, I found this in the Haskell 98 report (section 4.4.3.2):
The general form of a pattern binding is p match, where a match is the same structure as for function bindings above; in other words, a pattern binding is:
p | g1 = e1 | g2 = e2 ... | gm = em where { decls }
I did not even know these things existed, is there anyone who actually uses general pattern bindings?
If not, the question becomes whether removing these bindings would improve the language. It can be argued that it makes the language less consistent. Declarations would change from
decl -> (funlhs | pat0) rhs rhs -> = exp [where decls] | gdrhs [where decls]
to something like
decl -> funlhs rhs | pat0 srhs srhs -> = exp [where decls] rhs -> srhs | gdrhs [where decls]
On the other hand, we can remove most of section 4.3.2.2.
Any opinions?
At one point vty defined the standard colors using the following wonderfully elegant code: [black, red, green, yellow, blue, magenta, cyan, white] = map Color [0..7] Unfortunately ghc generated hideous code for this, so I had to inline it manually. So it goes. (yow, what got into me there?) I'm pretty sure I've seen this once or twice: (x,y) | someCondition = x y z | otherwise = b a r Stefan