[Haskell-cafe] Continuations

Joel Reymont joelr1 at gmail.com
Fri Dec 23 10:29:28 EST 2005


On Dec 23, 2005, at 1:06 PM, Bulat Ziganshin wrote:

> hm... you are waste much time unsystematically "optimizing"
> random-selected parts of program.

It's an assumption that you are making.

> what you want to buy with continuations and, more important, why you
> need it?

To try to implement "thread priorities". I would like to use  
continuations instead of threads and pick the next continuation to  
run based on how much time it has to responde to the poker server.

> JR> Alternatively, I would appreciate an example that requests,  
> say, two
> JR> Ints by saving a continuation each time and returns the sum.
>
> do a <- readLn :: IO Int
>    b <- readLn :: IO Int
>    return (a+b)
[...]
> amazed? :)

Amused yes, amazed no. The code does not save a continuation after  
requesting each integer and does not allow me to call/cc it saved  
continuation with an integer of my choice.

This is pretty much what I'm looking for: http://lisp.tech.coop/Web% 
2FContinuation

	Thanks, Joel

--
http://wagerlabs.com/







More information about the Haskell-Cafe mailing list