Proposal: split Chan and TChan into read and write ends

wren ng thornton wren at freegeek.org
Sun Oct 28 02:37:16 CEST 2012


On 10/27/12 12:28 PM, Johan Tibell wrote:
> 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.

I agree. I like the idea, and I'd like to see it gain traction, but I'm 
not so keen on breaking the Chan/TChan API. Also, there seem to be some 
API issues to be ironed out (e.g., someone proposed

     newBrodcastTChan :: STM (InTChan a, STM (OutTChan a))

which has an obvious meaning, over

     newInTChan :: STM (InTChan a)

which is going to take some explaining.)


It sounds like many people have implemented versions of this and 
uploaded them to Hackage already. Perhaps the best approach would be to 
(1) unify all those packages into a single "blessed" package, to reduce 
redundancy; (2) advertise that package as the way to go for new 
projects; (3) add it to the Platform if it gains traction; (4) maybe get 
around to deprecating the current Chan/TChan API some years down the 
road when it's no longer popular.

-- 
Live well,
~wren



More information about the Libraries mailing list