[haskeline] #112: Multi-line prompt

haskeline haskeline at projects.haskell.org
Wed Oct 20 03:48:54 EDT 2010

#112: Multi-line prompt
Reporter:  judah        |        Owner:     
    Type:  enhancement  |       Status:  new
Priority:  minor        |    Milestone:     
 Version:               |   Resolution:     
Keywords:               |  
Comment (by vivian):

 You could pass a function that tells you whether it needs another line:
 getMultiLine :: Monad m => (String -> m Bool) -> InputT m [String]
 getMultiLine test = do
   input <- getInputLine
   another <- lift $ test input
   if another
     then do
       rest <- getMultiLine test
       return $ input : rest
     else return input

 This would help with an issue with GHC #4316 in that we might want to
 merge the strings into one history entry.  That also introduces the issue
 of haskeline presenting multiline commands (those containing "\n") from
 the history.

Ticket URL: <http://trac.haskell.org/haskeline/ticket/112#comment:2>
haskeline <http://example.org/>
My example project

More information about the Haskeline mailing list