David Waern | 28 Sep 11:03 2012
Picon

Simplification of instances

Hi,

was there a change in how GHC simplifies instances sometime between
7.4.1 and 7.6.1? Haddock used to produce this:

  http://hackage.haskell.org/packages/archive/kan-extensions/2.7/doc/html/Data-Functor-Yoneda.html

but is now producing this:

  http://hackage.haskell.org/packages/archive/kan-extensions/3.1/doc/html/Data-Functor-Yoneda.html

Haddock uses tcRnGetInfo to get the instances.

Thanks,
David
Simon Peyton-Jones | 28 Sep 18:33 2012
Picon

RE: Simplification of instances

Ahem.  DFuns (what you get from is_dfun of a ClsInst) now have some "silent" arguments, that are added by GHC
and are not part of the original instance declaration. See
Note [Silent superclass arguments] in TcInstDcls.

But you don't want to print them.  Just do what InstEnv.pprInstanceHdr does (in InstEnv) to drop the silent arguments.

I've added some more comments (commit to come).

Simon

| -----Original Message-----
| From: glasgow-haskell-users-bounces <at> haskell.org [mailto:glasgow-haskell-
| users-bounces <at> haskell.org] On Behalf Of David Waern
| Sent: 28 September 2012 10:03
| To: glasgow-haskell-users <at> haskell.org
| Subject: Simplification of instances
| 
| Hi,
| 
| was there a change in how GHC simplifies instances sometime between
| 7.4.1 and 7.6.1? Haddock used to produce this:
| 
|   http://hackage.haskell.org/packages/archive/kan-
| extensions/2.7/doc/html/Data-Functor-Yoneda.html
| 
| but is now producing this:
| 
|   http://hackage.haskell.org/packages/archive/kan-
| extensions/3.1/doc/html/Data-Functor-Yoneda.html
| 
(Continue reading)

David Waern | 28 Sep 19:35 2012
Picon

Re: Simplification of instances

2012/9/28 Simon Peyton-Jones <simonpj <at> microsoft.com>:
> Ahem.  DFuns (what you get from is_dfun of a ClsInst) now have some "silent" arguments, that are added by GHC
and are not part of the original instance declaration. See
> Note [Silent superclass arguments] in TcInstDcls.
>
> But you don't want to print them.  Just do what InstEnv.pprInstanceHdr does (in InstEnv) to drop the silent arguments.
>
> I've added some more comments (commit to come).

Thanks!

I've written a Haddock patch that drops the arguments.

David

Gmane