RE: Typesafe MRef with a regular monad
6 Jun
2003
6 Jun
'03
4:17 p.m.
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
8486
Age (days ago)
8486
Last active (days ago)
0 comments
1 participants
participants (1)
-
George Russell