Proposal: split Chan and TChan into read and write ends

Johan Tibell johan.tibell at gmail.com
Sat Oct 27 18:28:47 CEST 2012


On Fri, Oct 26, 2012 at 8:23 PM, Brandon Simmons
<brandon.m.simmons at gmail.com> wrote:
> Hi everybody,
> Just discovered all the great discussion here, and although my
> google-fu turned up no prior discussions on this subject, I apologize
> if it has already been discussed.
>
> I propose that Chan and TChan should be implemented as a pair of read
> and write ends, initialized as follows:
>
>     newSplitChan :: IO (InChan a, OutChan a)
>
> 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.

I think this makes for a great package or perhaps an extra
Unidirectional module nested inside the Chan module. Breaking the well
used Chan API doesn't seem necessary in this case.



More information about the Libraries mailing list