Is there anything wrong with the following program?

> test :: Bool
> test | True = True
> test = False
> 
> main :: IO ()
> main = print test

(Apart from it's apparent uselessness. :-)

ghc and hbc reject it on grounds of multiple/conflicting definitions,
but Hugs and nhc accept it.

Here's a (slightly) more useful program:

> test :: Bool -> Bool
> test x = y
>    where y | x = x
>          y = False
> 
> main :: IO ()
> main = print (test True)

ghc and hbc still reject it, Hugs and nhc still accept it.

All accept the following program:

> test :: Bool -> Bool
> test x | True = True
> test x = False
> 
> main :: IO ()
> main = print (test True)


I can't see anything in the report to distinguish cafs from functions
in this case.

Cheers,

Graeme.

PS. I'm using ghc 2.08, hbc 0.9999.4 (1997 Apr 09), Hugs 1.4 (January
1998), and nhc13 (unreleased beta 980422).



Reply via email to