Description
Is your feature request related to a problem? Please describe.
Like a good functional programmer, I've been using function composition but just defining my own def compose : (b -> c) -> (a -> b) -> (a -> c)
. But it would be so much nicer if it was an infix operator.
Describe the solution you'd like
I'd like to have a built-in function composition operator. It can require the same capability as using functions in general (i.e. CLambda
) and hence provided by an equipped lambda
entity. Since it's already possible to define your own once you can use lambdas, I don't think it makes sense to make a separate capability for it.
Using .
as the syntax (as in Haskell) would be nice, and I think it should not introduce any ambiguity (we do use .
several other places in the grammar already - after a forall
and after a lambda - but they occur in different, clearly distinguished contexts). But I am not wedded to that particular syntax.