
On Fri, Oct 26, 2012 at 8:23 PM, Brandon Simmons
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.