Jump to content
Main menu
Main menu
move to sidebar
hide
Navigation
Haskell
Wiki community
Recent changes
Random page
HaskellWiki
Search
Search
Create account
Log in
Personal tools
Create account
Log in
Pages for logged out editors
learn more
Contributions
Talk
Editing
Syntactic sugar/Cons
(section)
Page
Discussion
English
Read
Edit
View history
Tools
Tools
move to sidebar
hide
Actions
Read
Edit
View history
General
What links here
Related changes
Special pages
Page information
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
=== Syntactic heroin === Compiler writers can only lose if they give way to the insistence of users requesting more syntactic sugar. Every user has his own preferred applications, everyone has his taste and everyone wants his special application and his taste to be respected in future language revisions. Who is authorised to decide which application is general and which is too special? Is it more important to have many syntactic alternatives such that all people can write with their individual styles or is it more important that code of several authors have homogenous appearance such that it can be read by all people? You can bet if new syntactic sugar arises many users will rush at it and forget about the analytic expression the special notation shall replace. To argue against that is like trying to take the most beloved toy from children. Every special notation leads to the question if it can be extended and generalised. Guards are extended to [[pattern guard]]s and [[list comprehension]] is generalised to [[parallel list comprehension]] in current versions of Haskell compilers. Infix notation for alphanumeric functions is already possible in Haskell98 but "lacks" the possibility to add arguments like in <hask>x `rel c` y</hask>. The last is not implemented, but was already requested. A solution using only Haskell98 infix operators is already [http://www.haskell.org/pipermail/haskell-cafe/2002-July/003215.html invented]. Further on, the more general [http://www.dcs.gla.ac.uk/mail-www/haskell/msg02005.html MixFix] notation was already proposed, not to forget the silent lifting of map data structures to [http://www.haskell.org/pipermail/haskell/2002-October/010629.html functions], [https://downloads.haskell.org/ghc/9.4.4/docs/users_guide/exts/rebindable_syntax.html#postfix-operators postfix operators], [[section of an infix operator|sections]] of [http://www.haskell.org/pipermail/haskell-cafe/2006-July/016683.html tuples], like <hask>(?,x,?)</hask>, [http://www.haskell.org/pipermail/haskell-cafe/2007-September/031544.html symbolic prefix operators]. What comes next? Rodney Bates called the phenomena not only "syntactic sugar" but "[http://portal.acm.org/citation.cfm?id=1071738 syntactic heroin]". :(See also http://www.cs.wichita.edu/~rodney/languages/Modula-Ada-comparison.txt) People start with a small dosis of syntactic sugar, they quickly want more, because the initial dose isn't enough for ecstasy any longer. If one drug no longer helps then stronger ones are requested. It is so much tempting because the users requesting syntactic sugar are not responsible for implementing it and for avoiding inferences with other language features.
Summary:
Please note that all contributions to HaskellWiki are considered to be released under simple permissive license (see
HaskellWiki:Copyrights
for details). If you don't want your writing to be edited mercilessly and redistributed at will, then don't submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource.
DO NOT SUBMIT COPYRIGHTED WORK WITHOUT PERMISSION!
Cancel
Editing help
(opens in new window)
Toggle limited content width