[Haskell-cafe] Re: mathematical notation and functional programming

Marcin 'Qrczak' Kowalczyk qrczak at knm.org.pl
Sat Jan 29 19:35:35 EST 2005


Stefan Monnier <monnier at iro.umontreal.ca> writes:

> OTOH I like the a<b<c shorthand because it's both "obvious" and
> unambiguous (as long as the return value of < can't be passed as an
> argument to <, which is typically the case when the return value is
> boolean and there's no ordering defined on booleans).

It's unambiguous even if the return value of < can be passed as an
argument to <. Operators are usually left-associative, right-associative
or non-associative. A non-associative operator can have an additional
semantics defined when it's used multiple times, just like a,b,c in
OCaml is neither a,(b,c) nor (a,b),c, or even a*b*c as a type.

-- 
   __("<         Marcin Kowalczyk
   \__/       qrczak at knm.org.pl
    ^^     http://qrnik.knm.org.pl/~qrczak/


More information about the Haskell-Cafe mailing list