[Haskell-cafe] Global fixity (our status quo) vs. local fixity

Jeffrey Brown jeffbrown.the at gmail.com
Mon Oct 19 19:39:04 UTC 2015


In Haskell, fixity is global. There are ten levels. You can't stick
something between two levels, and you can't subvert the order of the
levels. If you want something that binds before >>= but after the logical
operators && and ||, you're out of luck -- unless you're willing to define
synonyms for && and || that bind faster. (Tidal, a music DSL written in
Haskell (it's on Hackage), exemplifies that problem with its |+| operator.)

Conceptually, by contrast, fixity is local. The arithmetic operators (* + -
/ and **), for instance, have a certain fixity defined relative to each
other, and that order does not, I believe, in the mind of most users extend
beyond arithmetic.

Does anybody else think it would be nice if a library's author had only to
decide its operators' precedence relative to each other, and could let
users decide for themselves how fast its operators should bind relative to
operators from another library?

-- 
Jeffrey Benjamin Brown
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.haskell.org/pipermail/haskell-cafe/attachments/20151019/543f604b/attachment.html>


More information about the Haskell-Cafe mailing list