Proposal: Control.Concurrent.Async
Simon Marlow
marlowsd at gmail.com
Wed Jul 4 12:44:09 CEST 2012
On 03/07/2012 14:17, Ross Paterson wrote:
> On Tue, Jul 03, 2012 at 01:53:16PM +0100, Simon Marlow wrote:
>> On 18/06/2012 14:56, Ross Paterson wrote:
>>> Perhaps a convenient interface for the multiplexing part would be
>>>
>>> data AsyncF a = forall r. AsyncF (Async r) (r -> a)
>>>
>>> instance Functor AsyncF where
>>> fmap f (AsyncF a k) = AsyncF a (f . k)
>>>
>>> waitSTMF :: AsyncF a -> STM (Either SomeException a)
>>> waitSTMF (AsyncF a k) = fmap (fmap k) (waitSTM a)
>>
>> Good idea. In fact, I've added a Functor instance for Async itself - it
>> required a bit of refactoring but didn't add much overhead.
>
> So now you can simplify the interfaces of waitEither/waitAny et al?
>
> [BTW, could you generate the new docs with --hyperlink-source?]
Hackage has the docs now:
http://hackage.haskell.org/packages/archive/async/2.0.1.0/doc/html/Control-Concurrent-Async.html
Cheers,
Simon
More information about the Libraries
mailing list