
On Sat, Oct 27, 2012 at 12:28 PM, Johan Tibell
On Fri, Oct 26, 2012 at 8:23 PM, Brandon Simmons
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.
In the scenario where an extra module is added to the current libraries, it would be logical to then implement the current non-split Chan modules in terms of the split module. Are there arguments against doing that?