Partially applying a function that has an implicit parameter
Can I turn a method which takes an implicit parameter into a function? trait Tx def foo(bar: Any)(implicit tx: Tx) {} foo _ // error: could not find implicit value for parameter tx: Tx I am trying to achieve the following, preferably if I can somehow make it work with the plain call withSelection(deleteObjects) : trait Test { def atomic[A](fun: Tx => A): A def selection: Iterable[Any] def withSelection(fun: Iterable[Any] => Tx => Unit) { val sel = selection if (sel.nonEmpty) atomic { implicit tx => fun(sel)(tx) } } object deleteAction { def apply() { withSelection(deleteObjects) // ! } } def