[Haskell-cafe] GHC.Generics and newtypes

2013-01-27 Thread Roman Cheplyaka
Hi,

Is it possible to generate different instances for newtypes and
datatypes using GHC.Generics?

Roman

___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell-cafe] GHC.Generics and newtypes

2013-01-27 Thread José Pedro Magalhães
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 r...@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@haskell.org
 http://www.haskell.org/mailman/listinfo/haskell-cafe

___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell-cafe] GHC.Generics and newtypes

2013-01-27 Thread Roman Cheplyaka
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 j...@cs.uu.nl [2013-01-27 20:29:52+]
 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 r...@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@haskell.org
  http://www.haskell.org/mailman/listinfo/haskell-cafe
 

___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell-cafe] GHC.Generics and newtypes

2013-01-27 Thread José Pedro Magalhães
Ah, no. But that would be easy to add to the Datatype
classhttp://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 r...@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 j...@cs.uu.nl [2013-01-27 20:29:52+]
  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 r...@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@haskell.org
   http://www.haskell.org/mailman/listinfo/haskell-cafe
  

___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell-cafe] GHC.Generics and newtypes

2013-01-27 Thread Roman Cheplyaka
Sure. Should it go to the GHC bug tracker?

Roman

* José Pedro Magalhães j...@cs.uu.nl [2013-01-27 20:36:54+]
 Ah, no. But that would be easy to add to the Datatype
 classhttp://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 r...@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 j...@cs.uu.nl [2013-01-27 20:29:52+]
   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 r...@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@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe
   
 

___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe