Mads Lindstrøm wrote:
While trying to implement a GUI for GHCi, I have run into an annoying
concurrency problems. I think "GHC as a library" is at fault, as it
stalls (maybe some deadlock) when nobody is consuming it's output.
Thanks Mads, I took a look but didn't get to the bottom of the prob
Simon Peyton-Jones wrote:
| In typecheckedSource, I can only access the function definitions with
| type annotations, but not the data type declaration.
| In checkedModuleInfo, I can only access the "Names" of the exported
| entities, and but not their (inferred) types are not present.
You have
| In typecheckedSource, I can only access the function definitions with
| type annotations, but not the data type declaration.
| In checkedModuleInfo, I can only access the "Names" of the exported
| entities, and but not their (inferred) types are not present.
You have easy access to the data decl
Matthew Danish wrote:
On Thu, May 10, 2007 at 09:34:53AM +0100, Simon Marlow wrote:
And we do have support for this in GHC.
$ ghci
___ ___ _
/ _ \ /\ /\/ __(_)
/ /_\// /_/ / / | |GHC Interactive, version 6.7, for Haskell 98.
/ /_\\/ __ / /___| |http://www.haskell.org/gh
On Thu, May 10, 2007 at 09:34:53AM +0100, Simon Marlow wrote:
> And we do have support for this in GHC.
>
> $ ghci
>___ ___ _
> / _ \ /\ /\/ __(_)
> / /_\// /_/ / / | |GHC Interactive, version 6.7, for Haskell 98.
> / /_\\/ __ / /___| |http://www.haskell.org/ghc/
> \/
Simon Peyton-Jones wrote:
| Also if stmt =
|
| SomeModule.prettyPrinter "foobar"
|
| and SomeModule contains
|
| prettyPrinter x = putStrLn $ "Pretty: " ++ x
|
| then the let binding will not catch it.
Indeed, that's exactly what I meant in my original msg. I have always thought
it ugly
| Also if stmt =
|
| SomeModule.prettyPrinter "foobar"
|
| and SomeModule contains
|
| prettyPrinter x = putStrLn $ "Pretty: " ++ x
|
| then the let binding will not catch it.
Indeed, that's exactly what I meant in my original msg. I have always thought
it ugly that stdin and stdout are t
Hi
While wrapIO works in most cases, try running this:
:m +Control.Concurrent
forkIO (let foo = do threadDelay 100; print "A"; foo in foo)
I am not saying that this makes wrapIO unusable - just that it is not
bulletproof. If not using forkIO is ok, then this is a much easier
solution, than c
On Wed, May 09, 2007 at 10:48:15PM +0200, Mads Lindstr?m wrote:
> Hi
>
> Look at System.Posix.IO
>
> I do not know if that module can do what you want. But it does deal with
> FileDescriptors and handles.
>
> Maybe the dup function can help you. According to
> http://www2.lib.uchicago.edu/~keith
Hi Simon
The Interactive.hs program do not really redirect stdout. It intercepts
calls to putStrLn and getLine via let definitions:
mustWork "let putStrLn = MyPrelude.myPutStrLn"
mustWork "let getLine = MyPrelude.myGetLine"
-- mustWork either runs the given statement successfull
Hi
Look at System.Posix.IO
I do not know if that module can do what you want. But it does deal with
FileDescriptors and handles.
Maybe the dup function can help you. According to
http://www2.lib.uchicago.edu/~keith//tcl-course/topics/processes.html it
does:
"The dup implements the dup system ca
On Fri, May 04, 2007 at 08:12:55PM +0200, Pepe Iborra wrote:
> Mads
>
> On 04/05/2007, at 19:19, Mads Lindstr?m wrote:
>
> >Hi Pepe
> >
> >I would have liked something cross-platform.
> >
>
> Take a look at the unix-compat[1] package by Bjorn Bringert, although
> it looks like it won't help yo
| I am trying to use GHC as a library (see
| http://haskell.org/haskellwiki/GHC/As_a_library ). I want to get all the
| output from an interactive session and put in a GUI. This
| http://haskell.org/sitewiki/images/5/51/Interactive.hs seemed to be a
| nice starting point.
If you want to collect *a
Hi Pepe
Pepe Iborra wrote:
> Mads
>
> On 04/05/2007, at 19:19, Mads Lindstrøm wrote:
>
> > Hi Pepe
> >
> >
> > I would have liked something cross-platform.
> >
> >
>
>
> Take a look at the unix-compat[1] package by Bjorn Bringert, although
> it looks like it won't help you. Maybe it can be
Mads
On 04/05/2007, at 19:19, Mads Lindstrøm wrote:
Hi Pepe
I would have liked something cross-platform.
Take a look at the unix-compat[1] package by Bjorn Bringert, although
it looks like it won't help you. Maybe it can be extended.
Also, if stmt contains an error, wrapStmt will not be
Hi Pepe
I would have liked something cross-platform.
Also, if stmt contains an error, wrapStmt will not be evaluated, and the
resulting error is written to standard output or maybe to standard
error. Whichever way, I am back to the same problem.
Greetings,
Mads Lindstrøm
> I believe that the
I believe that the trick is to wrap your stmt in a IO handler that
captures stdout and returns it together with the value of your stmt.
That is, something with a type:
wrapStmt :: IO a -> IO (a,String)
It should be easy to implement wrapStmt using System.Posix.Process.
Then you just define
17 matches
Mail list logo