Deriving Generic1

Simon Peyton Jones simonpj at microsoft.com
Wed Jun 1 14:55:56 UTC 2016


Ryan
If you compile

newtype Compose f g a = Compose (f (g a)) deriving( Generic1 )
and do –show-iface on the resulting hi file, you’ll see

  $fGeneric1Compose ::

    forall (f :: * -> *) k (g :: k -> *).

    Functor f =>

    Generic1 (Compose f g)
I was expecting to see

  $fGeneric1Compose ::

    forall (f :: k1 -> *) k (g :: k -> k1).

    (..something..) =>

    Generic1 (Compose f g)
Otherwise the Generic1 instance only works if its first argument has kind (* -> *).
Is that the intention?  Maybe so…
Simon
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.haskell.org/pipermail/ghc-devs/attachments/20160601/9d52b681/attachment.html>


More information about the ghc-devs mailing list