#4316: Interactive "do" notation in GHCi
---------------------------------+------------------------------------------
    Reporter:  mitar             |        Owner:  vivian      
        Type:  feature request   |       Status:  patch       
    Priority:  normal            |    Milestone:  7.2.1       
   Component:  GHCi              |      Version:  6.12.3      
    Keywords:                    |     Testcase:              
   Blockedby:                    |   Difficulty:              
          Os:  Unknown/Multiple  |     Blocking:              
Architecture:  Unknown/Multiple  |      Failure:  None/Unknown
---------------------------------+------------------------------------------

Comment(by vivian):

 Replying to [comment:12 simonmar]:
 > Just a thought: couldn't we use the "altnerative layout rule" to detect
 when a line ends without closing all of its layout contexts, and enter a
 multi-line mode which ends with a blank line, or when all the layout
 contexts have been closed?

 I do not know how to 'hook' into the lexer to check whether a layout rule
 is open.  {{{Lexer.x, lexer}}}, about line 1961, is where layout is
 implemented.

 A statement "let foo = bar" is a valid expression at the GHCi command
 line, but could also be an open layout context expecting "in baz foo" to
 close the context on the next line.

 A trailing {{{do}}} on the command line generates an "Empty 'do'
 construct" error, not an error about layout, which is why I can not see
 (yet) how to get the layout context information from the parser.

 Perhaps simonmar could provide me with a pointer as to how to implement
 his suggestion?

-- 
Ticket URL: <http://hackage.haskell.org/trac/ghc/ticket/4316#comment:13>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler
_______________________________________________
Glasgow-haskell-bugs mailing list
[email protected]
http://www.haskell.org/mailman/listinfo/glasgow-haskell-bugs

Reply via email to