[web-devel] [conduit 0.2.x] generalizing sourceIO?

Bardur Arantsson spam at scientician.net
Wed Feb 8 20:33:35 CET 2012


On 02/08/2012 09:07 AM, Michael Snoyman wrote:
> On Wed, Feb 8, 2012 at 9:04 AM, Michael Snoyman<michael at snoyman.com>  wrote:
>> On Tue, Feb 7, 2012 at 11:18 PM, Erik de Castro Lopo
>> <mle+hs at mega-nerd.com>  wrote:
>>> Erik de Castro Lopo wrote:
>>>
>>>> Would it not be possible to achieve what you want with sourceState:
>>>>
>>>>      http://hackage.haskell.org/packages/archive/conduit/0.2.0/doc/html/Data-Conduit.html#v:sourceState
>>>
>>> No it wouldn't, but maybe that calls for a function sourceStateIO that
>>> has all the features of sourceIO and sourceState.
>>
>> That might make sense. There are definitely cases where it would be
>> useful. I don't want to change the type of sourceIO to the suggested
>> type, since:
>>
>> 1. It complicates things for the common case
>> 2. Returning a tuple means that when we return IOClosed, we still need
>> to return a state, even though it doesn't make sense.
>>
>> This should be a fairly minor change, I think I'll throw it in soon.
>>
>
> How's this?
>
> https://github.com/snoyberg/conduit/commit/7ab2a34d5baa40b7f98cec194305161527ecf370
>
> Michael

Looks great, thanks :).




More information about the web-devel mailing list