Typesafe MRef with a regular monad

Simon Peyton-Jones simonpj@microsoft.com
Fri, 6 Jun 2003 15:09:45 +0100


You can't overwrite an entry with a value of a different type, because
the keys are typed!  Any more than you can overwrite an IORef with a
value of a different type.
S

| -----Original Message-----
| From: Ralf Hinze [mailto:ralf@informatik.uni-bonn.de]
| Sent: 06 June 2003 15:01
| To: Simon Peyton-Jones; Tim Sweeney; haskell@haskell.org; Ashley
Yakeley
| Subject: Re: Typesafe MRef with a regular monad
|=20
| Am Freitag, 6. Juni 2003 15:47 schrieb Simon Peyton-Jones:
| > Yes, one *could* use dynamic types.  But the check would always
succeed!
|=20
| Why is that? If I overwrite an entry with a value of a different type,
| then the check fails. I am certainly missing something ...
|=20
| Cheers, Ralf
|=20