[Haskell-cafe] flip dot

Sebastian Sylvan sylvan at student.chalmers.se
Thu Sep 28 13:11:09 EDT 2006

On 9/28/06, Brian Hulley <brianh at metamilk.com> wrote:
> On Thursday, September 28, 2006 1:33 AM, Greg Fitzgerald  wrote:
> > Since there's talk of removal of the composition operator in
> > Haskell-prime,
> > how about this:
> >
> > Instead of:
> > foo = f . g
> >
> > you write:
> > foo = .g.f
> >
> > A leading dot would mean, "apply all unnamed parameters
> > to the function on the right".  A trailing dot would mean,
> >"apply the result of the left to the function on the right".
> Hi -
> I think the H' proposal
> http://hackage.haskell.org/trac/haskell-prime/wiki/CompositionAsDot is an
> extremely bad idea. I really don't see why people have so many problems with
> the idea of just placing spaces before and after the dot when used as an
> operator,

If C had something like that, we would use it as yet more reasons to
make fun of it for. Spaces around operators shouldn't be significant.
It's just extremly messy and ugly IMO.

> and in any case it's hard to think of a more important operator in
> a functional language than composition and a more fitting symbol for it than
> the simple dot.

Well I would think that '=' is more important, for example. Or how
about ->? There are many operators that absolutely essential for the
langauge. Composition is, after all, merely a library function. The
dot is a nice low-noise operator that could be put to good use as
selectors of records and modules (being simliar to other languages in
that regard is not a goal in itself, but certainly doesn't hurt).
Reserved symbols should get to "choose first" IMO, and then the rest
can be used for library functions.

How aboug using <> for compositon? It almost looks like a ring.

Sebastian Sylvan
UIN: 44640862

More information about the Haskell-Cafe mailing list