Narrower (per-method) GND

Joachim Breitner mail at joachim-breitner.de
Mon Jan 9 04:32:09 UTC 2017


Hi,

just responding to this one aspect:

Am Sonntag, den 08.01.2017, 21:16 -0500 schrieb David Feuer:
> but using defaults for
> the others would give poor implementations. To cover this case, I
> think it would be nice to add per-method GND-deriving syntax. This
> could look something like
> 
> instance C T where
>   deriving f
>   g = ....

Assuming
  newtype T = MkT S

You can achieve this using

  instance C T where
     f = coerce (f @F)
     g = ....

(which is precisely what GND does), so I don’t think any new syntax is
needed here.

Greetings,
Joachim

-- 
Joachim “nomeata” Breitner
  mail at joachim-breitner.dehttps://www.joachim-breitner.de/
  XMPP: nomeata at joachim-breitner.de • OpenPGP-Key: 0xF0FBF51F
  Debian Developer: nomeata at debian.org
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: This is a digitally signed message part
URL: <http://mail.haskell.org/pipermail/glasgow-haskell-users/attachments/20170108/8762e173/attachment.sig>


More information about the Glasgow-haskell-users mailing list