[Haskell-cafe] Why is $ right associative instead of leftassociative?

Tomasz Zielonka tomasz.zielonka at gmail.com
Sat Feb 4 14:42:01 EST 2006

On Sat, Feb 04, 2006 at 07:15:47PM -0000, Brian Hulley wrote:
> I think the mystery surrounding :: and : might have been that
> originally people thought type annotations would hardly ever be needed
> whereas list cons is often needed, but now that it is regarded as good
> practice to put a type annotation before every top level value
> binding, and as the type system becomes more and more complex (eg with
> GADTs etc), type annotations are now presumably far more common than
> list cons so it would be good if Haskell Prime would swap these
> operators back to their de facto universal inter-language standard of
> list cons and type annotation respectively.

I am not convinced. Even if you really want to write types for every
top-level binding, it's only one :: per binding, which can have a
definition spanning for many lines and as complicated type as you
want. On the other hand, when you are doing complicated list processing,
it is not uncommon to have four (or more) :'s per _line_.

Personally, I started my FP adventure with OCaml (which has the thing
the other way around), and I felt that the meanings of :: and : should
be reversed - before I even knew Haskell!

Best regards

I am searching for programmers who are good at least in
(Haskell || ML) && (Linux || FreeBSD || math)
for work in Warsaw, Poland

More information about the Haskell-Cafe mailing list