Jon Harrop wrote:
On Thursday 18 October 2007 13:46:10 you wrote:
  
From: Jon Harrop <jon@ffconsultancy.com>
    
Scala can do something similar by controlling evaluation simply by
altering the signature. However, I've reviewed Haskell recently and I
think complete laziness is more of a hindrance than a benefit. The only
think I'd like to see added to eager FPLs is the ability to pattern match
over lazy values, forcing them only when necessary.
      
What! You want Caml V3.1 (released in 1991 IIRC)!
I remember writing a lazy prolog interpreter using this feature.

Lazyness in ocaml works too, but it's more verbose.
    

How do you pattern match over lazy values in OCaml? If I've missed that, it 
would be really cool to find out! :-)

  
You have to explicitly force the lazy value first- but other than it being explicit, this is no different from other languages that implicitly force the value for you.  Well, Haskell has an option where a pattern match can always succeed that doesn't necessarily force the lazy value (I forget what it's called at the moment), but baring that, even standard Haskell pattern matching forces the value for the match.

Brian