On Tue, Jun 5, 2012 at 12:02 AM, Simon Peyton-Jones <simonpj@microsoft.com> wrote:
I see the boring code, but I don't see what you *want*!  I'm guessing you want "generalised newtype deriving" but why does that not work?

Yes, I (and I assume Bas) want generalised newtype deriving to work, but it doesn't.

I want to write something very simple:

{-# LANGUAGE GeneralizedNewtypeDeriving #-}
newtype Foo = Foo Int
    deriving (Eq, Show, Unbox)

But with the above, GHC says:

    No instances for (M.MVector MVector Foo, G.Vector Vector Foo)
      arising from the 'deriving' clause of a data type declaration

And then we begin the journey that eventually gets us to Bas's rather wordy code.