The unintuitive part is the choice of operator `<<` instead of `>>`. in your example `f << g` means do `g` first (i.e. 2 + 4 = 6) then do `f` on the result (i.e. 6 * 3 = 18). I would have expected `f >> g` for this behavior.
list << x
or writing to a stream: new File('test.txt') << 'hello world'
So if you read it as "forward the result of g into f" then it makes a little more sense.But I agree, it's still not very intuitive and for readability I would normally just write:
h = { f(g(it)) }
Which I think is far clearer. But that's partly an argument against functional programming style itself which would ordinarily see function composition as more idiomatic.