[Haskell-cafe] serialize an unknown type

2012-10-20 Thread Corentin Dupont
Hi the list! I have a simple question, how can I serialize/deserialize a structure like this: data InputChoice c deriving Typeable data Event a where InputChoice :: (Eq c, Show c) => [c] -> c -> Event (InputChoice c) (...) I'd like that the values of type "c" get serialized to a String... T

Re: [Haskell-cafe] Blocking IO & FIFOs

2012-10-20 Thread Jason Dusek
2012/10/20 Donn Cave : > Quoth Jason Dusek , > ... >> For my application, it's important to be able to run multiple >> queries against the same Bash session. Waiting for Bash to shut >> down is thus not a viable way to finalize the response. > > You could redirect to disk files and also use a pipe

Re: [Haskell-cafe] Blocking IO & FIFOs

2012-10-20 Thread Donn Cave
Quoth Jason Dusek , ... > For my application, it's important to be able to run multiple > queries against the same Bash session. Waiting for Bash to shut > down is thus not a viable way to finalize the response. You could redirect to disk files and also use a pipe to wait for exit. I suppose you

Re: [Haskell-cafe] Blocking IO & FIFOs

2012-10-20 Thread Jason Dusek
2012/10/20 Wilfried van Asten : > Perhaps an interleaving solution as in process-conduit is > still viable: > > - Check if one or both of the fifo's are still ready (Based >on your statement about the reading end receiving EOF >hIsEOF should work here). If both fifos are done the query >

Re: [Haskell-cafe] Blocking IO & FIFOs

2012-10-20 Thread Wilfried van Asten
Perhaps an interleaving solution as in process-conduit is still viable: - Check if one or both of the fifo's are still ready (Based on your statement about the reading end receiving EOF hIsEOF should work here). If both fifos are done the query is finished so break the loop. - Check if some outp

Re: [Haskell-cafe] Blocking IO & FIFOs

2012-10-20 Thread Jason Dusek
2012/10/20 Asten, W.G.G. van (Wilfried, Student M-CSC) : > Would you be happy with a solution like this: > > - First create two handles to two files in the tmp directory > - Then use StdStream's UseHandle to redirect std_err and std_out > (using CreatePipe for std_in) to these files > - Then wri

[Haskell-cafe] Blocking IO & FIFOs

2012-10-20 Thread Jason Dusek
Hi all, I am developing a coroutine-like interface to Bash. http://hpaste.org/76523 The idea is that one can send multiple "queries" to an interpreter and then collect the results of each query. How do we know when Bash is done with each query? Waiting for "no more output" seems ambiguous; so

[Haskell-cafe] Monad.Reader #21 call for copy

2012-10-20 Thread Edward Z. Yang
Call for Copy: The Monad.Reader - Issue 21 Whether you're an established academic or have only just started learning Haskell, if you have something to say, please consider writing an article for The Monad.Reader! The submission deadline for Issue 21 wi