
| Actually, I think it's a much bigger wart that pattern matching in let | and where is lazy, and everywhere else is strict, than that we have an | operator ~ on patterns with a clean compositional semantics. Way back in But ! patterns would restore what you want let !(x,y) = e in ... Arguably, it's non-uniform, but at least the strict version would be much more convenient than switching to case. Simon

Simon Peyton-Jones wrote:
| Actually, I think it's a much bigger wart that pattern matching in let | and where is lazy, and everywhere else is strict, than that we have an | operator ~ on patterns with a clean compositional semantics. Way back in
But ! patterns would restore what you want let !(x,y) = e in ...
Arguably, it's non-uniform, but at least the strict version would be much more convenient than switching to case.
Simon
Of course, it's nice to be able to get strict matching in a let if you want it. But what I think is a wart is that //patterns mean different things// in a let or where, and in a case or lambda. That's something you have to learn at some point, and I'd rather it was just a question of learning what ~ means. (You have to learn what lazy pattern matching means anyway, so you have to learn the //semantics// of ~ -- learning the syntax too isn't hard). BTW if let and where were strict-by-default, just as lambda and case are, then there would be no need for ! patterns, would there? John

On Fri, Jan 27, 2006 at 12:14:57PM +0100, John Hughes wrote:
BTW if let and where were strict-by-default, just as lambda and case are, then there would be no need for ! patterns, would there?
They'd still have a use on variables, but this change would remove the need for their special rule for let's.
participants (3)
-
John Hughes
-
Ross Paterson
-
Simon Peyton-Jones