"S.D.Mechveliani" wrote:
>
> Reading script "source/DPair.hs":
> Reading script "source/pol/EPol0_.hs":
> Parsing
> ERROR "source/pol/EPol0_.hs" (line 390): Syntax error in input
> (unexpected keyword "instance")
> -----------------------------------------------------------------
I suspect that the offside rule is acting up. Somewhere (before line
390) you've got a where that is empty or wrongly indented.
instances can only appear at top level, and it is being captured
by the incorrectly used previous where.
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?
Andy Gill