[Haskell-cafe] an idea for modifiyng data/newtype syntax: use `::=` instead of `=`

Sven Panne svenpanne at gmail.com
Sat Aug 8 20:18:43 UTC 2015


2015-08-08 21:14 GMT+02:00 Oliver Charles <ollie at ocharles.org.uk>:

> I hate to come across as a party-pooper, but do we really think it's
> realistic that any of these changes will be made? I understand that there
> may be benefits, but they don't outweigh the cost of breaking almost all
> existing code. The idea of opting in to this with pragmas just doesn't seem
> worth it, and further fragments the language, ultimately reducing
> readability when I pick up another author's code.
>

+1 to this. As has already been noted in a different thread, the "let's
introduce a pragma, nobody is forced to use it" argument is bogus. It
fragments the language for no good reason and one *is* forced to handle it
(when reading other people's code etc.). Furthermore, the current example
at hand is roughly at position 2 of Wadler's Law of Language Design (
https://wiki.haskell.org/Wadler's_Law), a.k.a. bikeshedding at the lexical
level. ;-)

Don't get me wrong: If Haskell was still at its infancy, renaming things
would probably be beneficial, as "type" is somehow really a misnomer. One
could discuss if "newtype" is really needed when we have "data" plus
strictness annotations (personally I'm a bit unsure what the common use
case for "case" is where they differ and what one might consider more
natural). Given the case that people seem to move towards GADTs anyway, the
discussion seems a bit moot.

Just my 2c.

P.S.: If you think this part of Haskell is a bit hard to read and
confusing, I seriously propose a week or two in C++'s wonderful
meta-programming world with templates... ;-)
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.haskell.org/pipermail/haskell-cafe/attachments/20150808/feac9ac5/attachment.html>


More information about the Haskell-Cafe mailing list