Re: [Haskell-cafe] Non-derivable Typeable

2013-01-22 Thread José Pedro Magalhães
Won't it derive it with StandaloneDeriving?


Cheers,
Pedro

On Tue, Jan 22, 2013 at 1:28 PM, Roman Cheplyaka r...@ro-che.info wrote:

 I need to declare a Typeable instance for a type which has an argument
 of kind * - *. GHC refuses to derive it.

 What is a recommended way to go about it?

 In particular, if I write the instance by hand, how important is the
 fingerprint, and how could I generate it?

 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] Non-derivable Typeable

2013-01-22 Thread Roman Cheplyaka
It doesn't seem to — am I doing something wrong?

  GHCi, version 7.6.1.20121207: http://www.haskell.org/ghc/  :? for help
  Loading package ghc-prim ... linking ... done.
  Loading package integer-gmp ... linking ... done.
  Loading package base ... linking ... done.
  Prelude :set -XDeriveDataTypeable -XStandaloneDeriving
  Prelude :m +Data.Typeable
  Prelude Data.Typeable data Foo m = Foo (m ())
  Prelude Data.Typeable deriving instance Typeable1 m = Typeable (Foo m)

  interactive:5:1:
  Can't make a derived instance of `Typeable (Foo m)':
`Foo' must only have arguments of kind `*'
  In the stand-alone deriving instance for
`Typeable1 m = Typeable (Foo m)'

Roman

* José Pedro Magalhães j...@cs.uu.nl [2013-01-22 13:36:26+]
 Won't it derive it with StandaloneDeriving?
 
 
 Cheers,
 Pedro
 
 On Tue, Jan 22, 2013 at 1:28 PM, Roman Cheplyaka r...@ro-che.info wrote:
 
  I need to declare a Typeable instance for a type which has an argument
  of kind * - *. GHC refuses to derive it.
 
  What is a recommended way to go about it?
 
  In particular, if I write the instance by hand, how important is the
  fingerprint, and how could I generate it?
 
  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] Non-derivable Typeable

2013-01-22 Thread Roman Cheplyaka
I just found mkTyCon3 which generates the fingerprint automatically.
(I was looking at Data.Typeable.Internal.mkTyCon before.)
That answers my question.

(Of course, a way to derive the instance would be even better...)

Roman

* Roman Cheplyaka r...@ro-che.info [2013-01-22 15:28:55+0200]
 I need to declare a Typeable instance for a type which has an argument
 of kind * - *. GHC refuses to derive it.
 
 What is a recommended way to go about it?
 
 In particular, if I write the instance by hand, how important is the
 fingerprint, and how could I generate it?
 
 Roman

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


Re: [Haskell-cafe] Non-derivable Typeable

2013-01-22 Thread José Pedro Magalhães
Yes, that will work. But soon we'll have poly-kinded Typeable in HEAD,
which will be able to derive that instance.


Cheers,
Pedro

On Tue, Jan 22, 2013 at 2:34 PM, Roman Cheplyaka r...@ro-che.info wrote:

 I just found mkTyCon3 which generates the fingerprint automatically.
 (I was looking at Data.Typeable.Internal.mkTyCon before.)
 That answers my question.

 (Of course, a way to derive the instance would be even better...)

 Roman

 * Roman Cheplyaka r...@ro-che.info [2013-01-22 15:28:55+0200]
  I need to declare a Typeable instance for a type which has an argument
  of kind * - *. GHC refuses to derive it.
 
  What is a recommended way to go about it?
 
  In particular, if I write the instance by hand, how important is the
  fingerprint, and how could I generate it?
 
  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] Non-derivable Typeable

2013-01-22 Thread Roman Cheplyaka
Thanks, looking forward to it!

Roman

* José Pedro Magalhães j...@cs.uu.nl [2013-01-22 14:41:25+]
 Yes, that will work. But soon we'll have poly-kinded Typeable in HEAD,
 which will be able to derive that instance.
 
 
 Cheers,
 Pedro
 
 On Tue, Jan 22, 2013 at 2:34 PM, Roman Cheplyaka r...@ro-che.info wrote:
 
  I just found mkTyCon3 which generates the fingerprint automatically.
  (I was looking at Data.Typeable.Internal.mkTyCon before.)
  That answers my question.
 
  (Of course, a way to derive the instance would be even better...)
 
  Roman
 
  * Roman Cheplyaka r...@ro-che.info [2013-01-22 15:28:55+0200]
   I need to declare a Typeable instance for a type which has an argument
   of kind * - *. GHC refuses to derive it.
  
   What is a recommended way to go about it?
  
   In particular, if I write the instance by hand, how important is the
   fingerprint, and how could I generate it?
  
   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