#1363: Sourcing multi-line scripts in GHCi: track line numbers, and bail out 
after
first error
---------------------------------+------------------------------------------
    Reporter:  Frederik          |        Owner:  vivian                    
        Type:  feature request   |       Status:  patch                     
    Priority:  normal            |    Milestone:  _|_                       
   Component:  GHCi              |      Version:  6.6                       
    Keywords:  multiline script  |     Testcase:                            
   Blockedby:                    |   Difficulty:  Moderate (less than a day)
          Os:  Unknown/Multiple  |     Blocking:                            
Architecture:  Unknown/Multiple  |      Failure:  None/Unknown              
---------------------------------+------------------------------------------

Comment(by vivian):

 > It would be good to have a test or two for `:script`, and also for the
 filenames and line numbers in errors.

 There is a patch for the testsuite, I'll improve that.

 [minor points cut]

 > Rather than the
 > {{{
 > fileLoop script >>= incrementLines
 > }}}
 > idiom I think it would be better to make `fileLoop` always increment the
 line number.

 Okay.

 > Code like this worries me:

 > What if `scriptLoop` alters other components of the state? Even if that
 can't happen now, I still think it would be better to to get the state
 again at the end.

 Okay.

 > I tried to fix this all up, but it was a deeper hole than I expected; I
 wonder if the code might benefit from a little refactoring. It might also
 be better to split the patch into two: the first bit just adding the
 `:script` command, and the second improving the error message locations.
 >

 Okay.  I'm not clear on the required refactoring (apart from the specific
 points mentioned).

 > Are you interested in working more on this?

 I'm happy to make the fixes and improvements you've suggested.

-- 
Ticket URL: <http://hackage.haskell.org/trac/ghc/ticket/1363#comment:18>
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