In fact I think these Typesafe MRef's are exactly equivalent
to dynamic types.  In other words, if you've got one,
you've got the other.  Ralf Hinze has just shown that
if you have dynamic types you can implement Typesafe MRef.

The reverse implementation would be something like

> data Dynamic = FM ()
>
> toDyn :: a -> Dynamic
> toDyn a = insert empty () a
>
> fromDynamic :: Dynamic -> Maybe a
> fromDynamic fm =
>    let
>       bogus :: Key () a
>       (_,bogus) = insert empty () undefined
>    in
>       lookup fm bogus

_______________________________________________
Haskell mailing list
[EMAIL PROTECTED]
http://www.haskell.org/mailman/listinfo/haskell

Reply via email to