I\'m following the tutorial Pattern matching & functional composition on Scala compose
and andThen
methods. There\'s such an example:
From compose
documentation:
Composes two instances of Function1 in a new Function1, with this function applied last.
so you should write
scala> val ummThenAhem = (addAhem _).compose(addUmm _)
ummThenAhem: String => java.lang.String =
to treat addAhem
and addUmm
as partially applied functions (i.e function1
)
scala> addAhem _
res0: String => java.lang.String =