I created the following code snippet:
class PimpToRight[A](f: A => Boolean) { def <| (a: A) = f(a) } implicit def f2pimp[A](f: A => Boolean) = new PimpToRight(f) class PimpToLeft[A](a: A) { def <|: (f: A => Boolean) = f(a) def |> (f: A => Boolean) = f(a) } implicit def a2pimp[A](a: A) = new PimpToLeft(a)
Right and left associative methods are available.
The following code works:
((_: Int) > 3) <| 7 ((_: Int) > 3) <|: 7 7 |> (_ > 3)
But this is not so:
(_ > 3) <| 7 (_ > 3) <|: 7
Is it possible to derive type parameters from right to left?
sschaef
source share