[Haskell-cafe] Hugs vs. GHCi

Dan Weston westondan at imageworks.com
Fri May 29 14:35:47 EDT 2009


http://haskell.org/onlinereport/exps.html#sect3.12

"Pattern bindings are matched lazily; an implicit ~ makes these patterns 
irrefutable. For example,

let (x,y) = undefined in e

does not cause an execution-time error until x or y is evaluated."

So GHCi is correct.

Dan

Vladimir Reshetnikov wrote:
> Hi,
> 
> The following expression evaluates to 1 in GHCi, but results in an
> error in Hugs:
> 
> let f x = let g y = [x,y] in (g 1, g []) in 1
> 
> What is the correct behavior?
> 
> Thanks
> Vladimir
> _______________________________________________
> Haskell-Cafe mailing list
> Haskell-Cafe at haskell.org
> http://www.haskell.org/mailman/listinfo/haskell-cafe
> 
> 



More information about the Haskell-Cafe mailing list