RE: haddock specializeInstHead

2017-10-23 Thread Simon Peyton Jones via ghc-devs
I don’t know, but my instinct is to stick to the monomorphic version for now, 
it that’s all you need.

Simon

From: ghc-devs [mailto:ghc-devs-boun...@haskell.org] On Behalf Of Alan & Kim 
Zimmerman
Sent: 20 October 2017 18:33
To: ghc-devs@haskell.org
Subject: haddock specializeInstHead

I am working the next stage of Trees that Grow into GHC [1], and need to update 
Haddock.
The `Specialize` module[2] exports a single function, `specializeInstHead` 
which is called once, specialised to `GhcRn`.
So all it needs to be for haddock use is

specializeInstHead :: InstHead GhcRn -> InstHead GhcRn
But the entire module is polymorphic in the AST parameter, so it has the 
following instead

specializeInstHead :: (Ord (IdP name), DataId name, SetName (IdP name),
NamedThing (IdP name))
   => InstHead name -> InstHead name

Question: does it need to be so polymorphic?

I am hitting issues getting the type parameter change worked through, and it 
seems a bit pointless to slog on with it if it is unnecessary.

Alan

[1] 
https://github.com/ghc/ghc/tree/wip/ttg-2017-10-13<https://na01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fghc%2Fghc%2Ftree%2Fwip%2Fttg-2017-10-13=02%7C01%7Csimonpj%40microsoft.com%7C26b5b86e96f145f964ce08d517e0cc6e%7C72f988bf86f141af91ab2d7cd011db47%7C1%7C0%7C636441176634035520=EU40hO%2FHQ70tAYkU1djv8e5wYNyHhw%2BTQImO3wzUer0%3D=0>
[2] 
https://github.com/haskell/haddock/blob/a5bdb46185b7c0b3fced9a7fac9a62883d9d57b7/haddock-api/src/Haddock/Interface/Specialize.hs#L87<https://na01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fhaskell%2Fhaddock%2Fblob%2Fa5bdb46185b7c0b3fced9a7fac9a62883d9d57b7%2Fhaddock-api%2Fsrc%2FHaddock%2FInterface%2FSpecialize.hs%23L87=02%7C01%7Csimonpj%40microsoft.com%7C26b5b86e96f145f964ce08d517e0cc6e%7C72f988bf86f141af91ab2d7cd011db47%7C1%7C0%7C636441176634035520=zgUxljZMi2uml5nHRrtj%2B3mcoQq7%2BFUFxbJzEqpHC5Y%3D=0>
___
ghc-devs mailing list
ghc-devs@haskell.org
http://mail.haskell.org/cgi-bin/mailman/listinfo/ghc-devs


haddock specializeInstHead

2017-10-20 Thread Alan & Kim Zimmerman
I am working the next stage of Trees that Grow into GHC [1], and need to
update Haddock.

The `Specialize` module[2] exports a single function, `specializeInstHead`
which is called once, specialised to `GhcRn`.

So all it needs to be for haddock use is

specializeInstHead :: InstHead GhcRn -> InstHead GhcRn

But the entire module is polymorphic in the AST parameter, so it has the
following instead

specializeInstHead :: (Ord (IdP name), DataId name, SetName (IdP name),
NamedThing (IdP name))
   => InstHead name -> InstHead name

Question: does it need to be so polymorphic?

I am hitting issues getting the type parameter change worked through, and
it seems a bit pointless to slog on with it if it is unnecessary.

Alan

[1] https://github.com/ghc/ghc/tree/wip/ttg-2017-10-13
[2]
https://github.com/haskell/haddock/blob/a5bdb46185b7c0b3fced9a7fac9a62883d9d57b7/haddock-api/src/Haddock/Interface/Specialize.hs#L87
___
ghc-devs mailing list
ghc-devs@haskell.org
http://mail.haskell.org/cgi-bin/mailman/listinfo/ghc-devs