Re: [Haskell-cafe] question about interruptable state runner

2011-06-13 Thread Mario Blažević
On 11-06-09 04:14 PM, Alexander V Vershilov wrote: Hello. I'm writing a small tcp server with that can handle connections and answer by rules writen in a small script that can be interpreted by server. For this purpose I've written an interpreter that has type ErrorT MyError (StateT ScriptSt

Re: [Haskell-cafe] question about interruptable state runner

2011-06-10 Thread Alexander V Vershilov
Fri, Jun 10, 2011 at 03:27:44PM +0200, Heinrich Apfelmus wrote > Alexander V Vershilov wrote: > > > > I'm writing a small tcp server with that can handle connections and > > answer by rules writen in a small script that can be interpreted by server. > > For this purpose I've written an interpreter

Re: [Haskell-cafe] question about interruptable state runner

2011-06-10 Thread Antoine Latter
On Thu, Jun 9, 2011 at 4:04 PM, Alexander V Vershilov wrote: > Hello. > > Thu, Jun 09, 2011 at 01:40:51PM -0500, Antoine Latter wrote >> On Thu, Jun 9, 2011 at 3:14 PM, Alexander V Vershilov >> wrote: >> > Hello. >> > >> > I'm writing a small tcp server with that can handle connections and >> > a

Re: [Haskell-cafe] question about interruptable state runner

2011-06-10 Thread Yves Parès
Just for the culture (because Heinrich's solution is undoubtly simpler) you can also achive this using continuations. This is one of the purposes of the Cont monad, used jointly with a State monad, you can store the continuations and resume them later. 2011/6/10 Heinrich Apfelmus > Alexander V

Re: [Haskell-cafe] question about interruptable state runner

2011-06-10 Thread Heinrich Apfelmus
Alexander V Vershilov wrote: I'm writing a small tcp server with that can handle connections and answer by rules writen in a small script that can be interpreted by server. For this purpose I've written an interpreter that has type ErrorT MyError (StateT ScriptState IO) so I can call "native

Re: [Haskell-cafe] question about interruptable state runner

2011-06-09 Thread Alexander V Vershilov
Hello. Thu, Jun 09, 2011 at 01:40:51PM -0500, Antoine Latter wrote > On Thu, Jun 9, 2011 at 3:14 PM, Alexander V Vershilov > wrote: > > Hello. > > > > I'm writing a small tcp server with that can handle connections and > > answer by rules writen in a small script that can be interpreted by server

Re: [Haskell-cafe] question about interruptable state runner

2011-06-09 Thread Antoine Latter
On Thu, Jun 9, 2011 at 3:14 PM, Alexander V Vershilov wrote: > Hello. > > I'm writing a small tcp server with that can handle connections and > answer by rules writen in a small script that can be interpreted by server. > For this purpose I've written an interpreter that has type > >  ErrorT MyErr

[Haskell-cafe] question about interruptable state runner

2011-06-09 Thread Alexander V Vershilov
Hello. I'm writing a small tcp server with that can handle connections and answer by rules writen in a small script that can be interpreted by server. For this purpose I've written an interpreter that has type ErrorT MyError (StateT ScriptState IO) so I can call "native" IO function in that sc