[Haskell-cafe] how to add monad-stack to network-conduit

Alexander V Vershilov alexander.vershilov at gmail.com
Tue Feb 21 16:10:16 CET 2012


Hello.

I have got next problem: I want to have database connection pool
in server based on network-conduit. 
So I wanted to be able to do

> runTCPServer options action 
>   where 
>     action src snk = 
>       pool <- ask
>       ....
>           

In this situation I can make pool `action's parameter, but in more
difficult situations (many methods inside) is would be painfull.

Also I wanted to have some kind of State for each thread, e.g.

> action src snk = src $= act1 $= act2 $= act3 $$ snk

in act1, act2, act3 I want to read and change state.

Is it possible? And how to do it if it is?

--
Alexander Vershilov
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 490 bytes
Desc: Digital signature
URL: <http://www.haskell.org/pipermail/haskell-cafe/attachments/20120221/356faa71/attachment.pgp>


More information about the Haskell-Cafe mailing list