The following code illustrates a bug in hugs' implementation of layout:

--------------
class C a where
f = f
--------------

To which hugs98 replies:

Prelude> :l test41.hs
Reading file "test41.hs":
ERROR "test41.hs" (line 2): No member "f" in class "C"

According to the layout rule, the code should be parsed as:

--------------
{class C a where {
}f = f}
--------------

i.e. an empty class declaration followed by a top-level binding.  The reason
is that in Haskell 98 the layout rule now explicitly states that nested
layout scopes should be strictly increasing in indentation.

Yes, I went looking for this bug because I suspected it was there :-)

Cheers,
        Simon

Reply via email to