#4316: Multiline commands in GHCi
------------------------------+---------------------------------------------
Reporter: mitar | Owner: vivian
Type: feature request | Status: patch
Priority: normal | Milestone: 7.2.1
Component: GHCi | Version: 6.12.3
Resolution: | Keywords:
Testcase: | Blockedby:
Difficulty: | Os: Unknown/Multiple
Blocking: | Architecture: Unknown/Multiple
Failure: None/Unknown |
------------------------------+---------------------------------------------
Comment(by vivian):
Replying to [comment:31 mitar]:
> Great work. But so my initial idea was lost. ;-(
I think that your original idea is a good idea. I have implemented this
first because it is an order of magnitude simpler. I personally do not
yet know how to implement your idea in GHCi.
{{{
Control.Monad.State> flip evalStateT 10 $ do
Control.Monad.State| i <- get
Control.Monad.State| lift $ print i
10
Control.Monad.State| put 11
Control.Monad.State| j <- get
Control.Monad.State| lift $ print (i+j)
21
Control.Monad.State|
}}}
I would have to know how to evaluate `HValue`s, how to type them, and how
to pass them between lines in our monads. That is, we have a polymorphic
`(>>=)` to chain `HValue`s. And we also have to somehow know if we need
to display output (is this the IO monad? did that computation produce a
side-effect? can I/should I display a value?).
This is not at all impossible, just more difficult than the current
multiline commands. Please note that when I first submitted the patch I
mentioned the possibility of leaving the ticket open or creating a new
one.
--
Ticket URL: <http://hackage.haskell.org/trac/ghc/ticket/4316#comment:32>
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