27 Jan 2013 21:17
27 Jan 2013 21:29
Re: GHC.Generics and newtypes
José Pedro Magalhães <jpm <at> cs.uu.nl>
2013-01-27 20:29:52 GMT
2013-01-27 20:29:52 GMT
Hi Roman,
Yes, the automatic derivation of Generic instances does not see through newtypes.
Cheers,
Pedro
On Sun, Jan 27, 2013 at 8:17 PM, Roman Cheplyaka <roma <at> ro-che.info> wrote:
Hi,
Is it possible to generate different instances for newtypes and
datatypes using GHC.Generics?
Roman
_______________________________________________
Haskell-Cafe mailing list
Haskell-Cafe <at> haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe
_______________________________________________ Haskell-Cafe mailing list Haskell-Cafe <at> haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
27 Jan 2013 21:34
Re: GHC.Generics and newtypes
Roman Cheplyaka <roma <at> ro-che.info>
2013-01-27 20:34:33 GMT
2013-01-27 20:34:33 GMT
Sorry, I wasn't clear. What I want is somehow to find out whether the type under consideration is declared using data or newtype. Is it possible? Roman * José Pedro Magalhães <jpm <at> cs.uu.nl> [2013-01-27 20:29:52+0000] > Hi Roman, > > Yes, the automatic derivation of Generic instances does not see through > newtypes. > > > Cheers, > Pedro > > On Sun, Jan 27, 2013 at 8:17 PM, Roman Cheplyaka <roma <at> ro-che.info> wrote: > > > Hi, > > > > Is it possible to generate different instances for newtypes and > > datatypes using GHC.Generics? > > > > Roman > > > > _______________________________________________ > > Haskell-Cafe mailing list > > Haskell-Cafe <at> haskell.org > > http://www.haskell.org/mailman/listinfo/haskell-cafe > >
27 Jan 2013 21:36
Re: GHC.Generics and newtypes
José Pedro Magalhães <jpm <at> cs.uu.nl>
2013-01-27 20:36:54 GMT
2013-01-27 20:36:54 GMT
Ah, no. But that would be easy to add to the Datatype class, I think. Perhaps
open a feature request?
Cheers,
Pedro
On Sun, Jan 27, 2013 at 8:34 PM, Roman Cheplyaka <roma <at> ro-che.info> wrote:
Sorry, I wasn't clear. What I want is somehow to find out whether the
type under consideration is declared using data or newtype.
Is it possible?
Roman
* José Pedro Magalhães <jpm <at> cs.uu.nl> [2013-01-27 20:29:52+0000]> Hi Roman,
>
> Yes, the automatic derivation of Generic instances does not see through
> newtypes.
>
>
> Cheers,
> Pedro
>
> On Sun, Jan 27, 2013 at 8:17 PM, Roman Cheplyaka <roma <at> ro-che.info> wrote:
>
> > Hi,
> >
> > Is it possible to generate different instances for newtypes and
> > datatypes using GHC.Generics?
> >
> > Roman
> >
> > _______________________________________________
> > Haskell-Cafe mailing list
> > Haskell-Cafe <at> haskell.org
> > http://www.haskell.org/mailman/listinfo/haskell-cafe
> >
_______________________________________________ Haskell-Cafe mailing list Haskell-Cafe <at> haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
27 Jan 2013 21:39
Re: GHC.Generics and newtypes
Roman Cheplyaka <roma <at> ro-che.info>
2013-01-27 20:39:44 GMT
2013-01-27 20:39:44 GMT
Sure. Should it go to the GHC bug tracker? Roman * José Pedro Magalhães <jpm <at> cs.uu.nl> [2013-01-27 20:36:54+0000] > Ah, no. But that would be easy to add to the Datatype > class<http://hackage.haskell.org/packages/archive/base/4.6.0.0/doc/html/GHC-Generics.html#g:3>, > I think. Perhaps > open a feature request? > > > Cheers, > Pedro > > On Sun, Jan 27, 2013 at 8:34 PM, Roman Cheplyaka <roma <at> ro-che.info> wrote: > > > Sorry, I wasn't clear. What I want is somehow to find out whether the > > type under consideration is declared using data or newtype. > > > > Is it possible? > > > > Roman > > > > * José Pedro Magalhães <jpm <at> cs.uu.nl> [2013-01-27 20:29:52+0000] > > > Hi Roman, > > > > > > Yes, the automatic derivation of Generic instances does not see through > > > newtypes. > > > > > > > > > Cheers, > > > Pedro > > > > > > On Sun, Jan 27, 2013 at 8:17 PM, Roman Cheplyaka <roma <at> ro-che.info> > > wrote: > > > > > > > Hi, > > > > > > > > Is it possible to generate different instances for newtypes and > > > > datatypes using GHC.Generics? > > > > > > > > Roman > > > > > > > > _______________________________________________ > > > > Haskell-Cafe mailing list > > > > Haskell-Cafe <at> haskell.org > > > > http://www.haskell.org/mailman/listinfo/haskell-cafe > > > > > >
RSS Feed