[web-devel] A little trouble upgrading to conduit 0.4.x
Bardur Arantsson
spam at scientician.net
Wed Apr 4 17:19:18 CEST 2012
On 04/04/2012 04:22 PM, Michael Snoyman wrote:
> On Wed, Apr 4, 2012 at 5:17 PM, Bardur Arantsson<spam at scientician.net> wrote:
>> Hi all,
>>
>> I'm upgrading various bits and bobs to conduit 0.4.x, but I've hit a little
>> snag with "sourceStateIO". The following function fails to compile:
>>
> In conduit 0.2, a Source always implicitly wrapped up the inner monad
> in a ResourceT transformer. This caused complications, so now you need
> to explicitly add a ResourceT wrapper when it's needed.
> `sourceStateIO` is an example of such a function that requires the
> functionality of a `ResourceT`. Instead of making a requirements in
> the type that the inner monad be `ResourceT m`, there's a class
> constraint that the inner monad be an instance of `MonadResource`.
I'm wondering if I can just have a simple
transPipe runResourceT $ sourceQuery ...
wrapper so that old callers can remain unmodified. This would give the
old callers the (Source IO [SQLData]) that they expect. As far as I can
tell, the open/close behavior would not be modified by transPipe.
Is there any reason that this wouldn't work?
Regards,
More information about the web-devel
mailing list