[Haskell-cafe] Implementation of "Dynamic" datatype

Stefan O'Rear stefanor at cox.net
Fri Mar 2 18:55:49 EST 2007


the current type:

data Dynamic = Dynamic TypeRep Obj

the new type, if lucky:

data Dynamic = Dynamic !(a -> TypeRep) a

if unlucky:

data TypeableD a = TypeableD (a -> TypeRep)
data Dynamic = Dynamic (TypeableD a) a

either way, the typeclass approach gives a lot more boxing.


More information about the Haskell-Cafe mailing list