[Haskell-cafe] ANNOUNCE: pqueue-mtl, stateful-mtl

Sittampalam, Ganesh ganesh.sittampalam at credit-suisse.com
Mon Feb 16 16:18:37 EST 2009

Dan Doel wrote:
> Someone already mentioned using Dynamic as an alternate base (for
> instance, use a Map of dynamics for underlying storage). Of course,
> the implementation of Dynamic in GHC uses unsafeCoerce, just like ST,
> so you may not count that.   
> However, using GADTs, you can implement Dynamic safely for a closed
> universe of types. So you could create a polymorphic reference monad
> for whatever such universe you wished. Further, if you actually had
> open GADTs, you could actually add the relevant type-rep constructor
> for every type you declared. For instance, jhc's implementation of
> type classes internally uses such a GADT, so one could theoretically
> make a safe Dynamic, and thus a safe polymorphic reference monad.     

Apart from the other inconveniences, all of these solutions involve
runtime overhead, which is a shame.


Please access the attached hyperlink for an important electronic communications disclaimer: 


More information about the Haskell-Cafe mailing list