The mutable cell is in the tail.  A [TVar a] would be quite different.
You can read about a very similar impl (based on MVars) in the original
"Concurrent Haskell" paper (on my papers page)

S

| -----Original Message-----
| From: Joel Reymont [mailto:[EMAIL PROTECTED]
| Sent: 06 December 2005 11:28
| To: Simon Peyton-Jones
| Cc: Haskell Cafe
| Subject: TChan implementation: Why TVarList
| 
| Simon,
| 
| Why did you guys implement TChan on top of your own TVarList instead
| of a regular list?
| 
| -- | 'TChan' is an abstract type representing an unbounded FIFO
channel.
| data TChan a = TChan (TVar (TVarList a)) (TVar (TVarList a))
| 
| type TVarList a = TVar (TList a)
| data TList a = TNil | TCons a (TVarList a)
| 
|       Thanks, Joel
| 
| --
| http://wagerlabs.com/
| 
| 
| 
| 

_______________________________________________
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe

Reply via email to