
On Wednesday 06 Apr 2005 8:54 am, Tomasz Zielonka wrote:
BTW, in the ghc survey I asked the ghc folk for type specialisation to allow unboxing in polymorphic data types. Dunno when they're going to deliver that though :-)
I am not sure I fully understand, but if I do, it would be a nice feature.
Useage would be something like this perhaps.. newtype IAVL a = IAVL (AVL (# Int# , a #)) mapIAVL :: (a -> b) -> IAVL a -> IAVL b mapIAVL f (IAVL iavl) = IAVL (mapAVL (\(# i, a #) -> (# i, f a #)) iavl) So I'd still have to create a distinct type and distinct functions for operating on that type. But those new functions would usually be simple one liners which re-use the fully polymorphic definitions (mapAVL in this example). But I think this or something similar this will be difficult in practice. Regards -- Adrian Hey