Hacker News new | ask | show | jobs
by dan-robertson 1465 days ago
I’ve sometimes thought that a reasonable alternate choice would be:

  f g = composition of f then g
  x.f = f applied to x
  x.f g h = in regular notation h(g(f(x))
Though slightly different precedence rules may be preferable.

I think the k in awk considered juxtaposition-as-string-concatenation to have been a mistake by the way.

Some other reasonable choices may be:

- disallowed syntax

- multiplication (which, for matrices, is a special case of function composition and application)

- inner join which can be seen a bit like function composition but for relations instead of functions

- sequencing (ie instead of ‘;’)

1 comments

That's an interesting idea, but how does it work for functions of multiple arguments?

If functions are curried, then I suppose the syntax for `f x y` would be `y.(x.f)`, which maybe you could write as `y.x.f` if the associativity worked as such. But that means you have to provide your arguments in reverse order?

If functions are not curried, do you write `(x, y).f`?