infix public fun<V, T, R> Function1<T, R>.compose(before: (V) -> T): (V) -> R {
return { v: V -> this(before(v)) }
}
This works, but I would have thought function composition was so important it would have been in the standard library. Is it and I have just missed it?
I appreciate some people never use function composition, I just think it ought to be in the standard library. It isn’t but no worries I have the function needed. I was aware of funKTionale, I just didn’t want the extra dependency just for the one function. Question answered; thanks for doing so promptly, very much appreciated.