Proposal: split Chan and TChan into read and write ends
haskell at benmachine.co.uk
Sat Oct 27 12:59:49 CEST 2012
On Sat, Oct 27, 2012 at 4:23 AM, Brandon Simmons
<brandon.m.simmons at gmail.com> wrote:
> I've implemented this already here:
> http://hackage.haskell.org/package/chan-split . You can ignore the
> type classes I've defined; they're there for my own reasons and not
> part of the proposal.
So what's the complete API that we're discussing here? I think the
/idea/ is great, but it doesn't feel like a concrete proposal until we
have a list of type signatures, so we can discuss the details like
whether or not `dupChan` is a good name for that operation (my
instinct is that it sounds pretty much the same as `cloneChan`, and
it's going to be hard to remember the difference).
I think my preferred signature for `newBroadcastTChan` would be `STM
(InTChan a, STM (OutTChan a))` or something similar. Then `dupChan`
might be unnecessary.
More information about the Libraries