Yes, one *could* use dynamic types. But the check would always succeed! That suggests a lack in the static type system. It's not surprising: the soundness depends on the un-forgeability of keys. So it's reasonable that there should be some language extension. I'm just looking for the minimal such extension. Finite maps see a bit of a big hammer.
Simon | -----Original Message----- | From: Ralf Hinze [mailto:[EMAIL PROTECTED] | Sent: 06 June 2003 14:29 | To: Simon Peyton-Jones; Tim Sweeney; [EMAIL PROTECTED]; Ashley Yakeley | Subject: Re: Typesafe MRef with a regular monad | | 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 | _______________________________________________ Haskell mailing list [EMAIL PROTECTED] http://www.haskell.org/mailman/listinfo/haskell