> Here is an example of the same thing:
> 
> data Foo = Foo
> data Bar = Bar
> 
> instance Show Foo 
>   where
> showsPrec Foo = showString "Foo"
>       -- This showsPrec is wrongly indented, making the previous
>       -- where capture the rest of the script.
> instance Show Bar 
>       -- this instance causes a problem, because it is no longer
>       -- top level.
>   where
>   showsPrec Bar = showString "Bar"
> 
> Simon Marlow: Do you want to comment on why GHC works,
> and Hugs fails?

This has come up several times (just search the mailing list archives for
more details).  Basically, Haskell 98 specifies that the defintiions in the
where clause must be indented further to the right than the enclosing
definition context.  In this case, that forces the where clause to be empty.

Hugs doesn't implement this particular restriction, hence the different in
behaviour between Hugs & GHC on the above example.

Cheers,
        Simon

Reply via email to