Typesafe MRef with a regular monad
Ralf Hinze
ralf@informatik.uni-bonn.de
Fri, 6 Jun 2003 15:28:44 +0200
Am Freitag, 6. Juni 2003 15:23 schrieb Simon Peyton-Jones:
> Oh bother, I forgot to add that you can of course insert a new value
> with an old key (suitably typed) and have it overwrite. Else, as you
> say, there would not be much point.
>
> Maybe it'd be better to have a separate key-construction function
> newKey :: k -> Key k a
> instead of having insert return a key.
>
> S
Seriously, isn't this just an application of dynamics? The key
type allows us to insert a cast when looking up a data structure
of dynamic values?
Cheers, Ralf