Proposal: change to qualified operator syntax
john at repetae.net
Tue Jul 7 23:04:48 EDT 2009
On Tue, Jul 07, 2009 at 05:58:54PM +0200, haskell at henning-thielemann.de wrote:
> Adding to an old thread:
> I like to note that I'm against this proposal. The example given in
> namely [Red..] can be easily resolved by adding a space, thus [Red ..].
> I use qualified operators occasionally, since I use NumericPrelude and
> thus have to import some things from Prelude in a qualified way. As there
> will appear more and more infix operators in libraries along with more
> name clashes (e.g. recently discussed List.++ and Monoid.++), qualified
> operator names will become not so uncommon. Of course, to keep the spirit
> of infix operators, you will better define custom operators locally, but
> this is only reasonable if you use an infix operator more than once.
> The current syntax is also in a way consistent, since e.g. (+) coincides
> with a two side operator section, which is no longer true with the new
> proposal. Also (...) and `...` are dual, which is a nice property.
Yeah. reading it again, I know this will break my code. I am not sure
whether anyone else does it, but a common idiom for me is
import List as L
import Set as S
if S.isEmpty (x S.\\ y) then y L.\\ x
or somesuch. Are qualified operators really that uncommon? I would think
they would be used fairly often...
John Meacham - ⑆repetae.net⑆john⑈ - http://notanumber.net/
More information about the Haskell-prime