
4 Jun
2012
4 Jun
'12
7:57 p.m.
My desire probably doesn't overlap much with what others have described in this thread, apologies. I *think* they want generalized newtype deriving to work for Unbox instances. I want to be able to write definition like this (pseudo code): data UnpackedList a = forall a. Unbox a => Cons {-# UNPACK #-} !a (UnpackedList a) | Nil and have GHC generate appropriate data type definitions at call sites. In other words, I want polymorphic unpacking to work as long as the unpacked field is unboxable (i.e. is member of some Unobx type class.) I believe I've described this desire to you before. Unfortunately it seems like a really hard problem. -- Johan