Unboxed Vectors of newtype'd values

Daniel Peebles pumpkingod at gmail.com
Tue Jun 5 21:56:07 CEST 2012


Yep, that works! Sweet!

On Tue, Jun 5, 2012 at 3:54 PM, Andres Löh <andres at well-typed.com> wrote:

> Hi Bryan.
>
> > 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
>
> Yes, because these are superclasses of Unbox. So can't you simply say this:
>
> > newtype Foo = Foo Int
> >   deriving (Eq, Show, Unbox, M.MVector MVector, G.Vector Vector)
>
> ?
>
> Cheers,
>  Andres
>
> --
> Andres Löh, Haskell Consultant
> Well-Typed LLP, http://www.well-typed.com
>
> _______________________________________________
> Libraries mailing list
> Libraries at haskell.org
> http://www.haskell.org/mailman/listinfo/libraries
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.haskell.org/pipermail/libraries/attachments/20120605/49334a2d/attachment.htm>


More information about the Libraries mailing list