data families/newtype instances allow `DatatypeContext`s ?

Anthony Clayden anthony.d.clayden at gmail.com
Mon Mar 13 06:20:48 UTC 2023


https://discourse.haskell.org/t/choosing-data-representation-based-on-type/5970/4?u=antc2

A `DatatypeContext` on a `newtype instance` gets the usual warning it's
deprecated. But the decl is accepted -- at GHC 8.10. (It doesn't achieve
what the O.P. was asking for -- but then I wouldn't expect it to.)

Is this behaviour deliberate, or more of an accident? I'm surprised such a
modern feature (datatype families) tolerates such an old/deprecated feature.

I suppose this means the two features are orthogonal -- which is kinda a
Good Thing (wrt some continuing discussions).

AntC
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.haskell.org/pipermail/glasgow-haskell-users/attachments/20230313/220152b2/attachment.html>


More information about the Glasgow-haskell-users mailing list