I am trying to compose these two functions:
// some case class that just holds data
case class DataMap( ... )
val action(i: Int)(data: DataMap): DataMap = { ... }
val tryFunction: DataMap => Try[DataMap] = Try.apply[DataMap]
val actionFunction: DataMap => DataMap = action(2)
tryFunction compose actionFunction
Then I get these errors:
Unapplied methods are only converted to functions when a function type is expected.
You can make this conversion explicit by writing `apply _` or `apply(_)` instead of `apply`.
val tryFunction = Try.apply[DataMap]
^
Unapplied methods are only converted to functions when a function type is expected.
You can make this conversion explicit by writing `action _` or `action(_)` instead of `action`.
val actionFunction = action(1)
^
Can someone explain why this error comes up, and how to avoid it?