[GHC] #1253: Can't use explicit braces/semicolons (i.e. non-layout) at top level with ghci

GHC trac at galois.com
Fri Mar 30 06:22:39 EDT 2007


#1253: Can't use explicit braces/semicolons (i.e. non-layout) at top level with
ghci
-------------------------+--------------------------------------------------
    Reporter:  guest     |       Owner:         
        Type:  bug       |      Status:  new    
    Priority:  normal    |   Milestone:         
   Component:  Compiler  |     Version:  6.6    
    Severity:  normal    |    Keywords:         
  Difficulty:  Unknown   |    Testcase:         
Architecture:  Unknown   |          Os:  Unknown
-------------------------+--------------------------------------------------
The following file is rejected by ghc and ghci, but accepted by hugs.

 {{{
 {
 x =
 3;
 }
 }}}

 The work-around is to include 'module Main where' before the opening brace
 in the first line.

 The error reported is:

 layoutbug.hs:1:0: parse error on input `{'

 I discovered this bug whilst assisting a programmer who uses a
 screenreader and hence finds layout code quite unhelpful. Blind and
 partially sighted users in general may well hit this problem!

 My reading of the haskell report suggests that the code above is valid
 haskell98 (looking at the grammar, one alternative for 'module' is 'body',
 and 'body' can be { topdecls } )

-- 
Ticket URL: <http://hackage.haskell.org/trac/ghc/ticket/1253>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler


More information about the Glasgow-haskell-bugs mailing list