Skip to content
This repository has been archived by the owner on Jul 29, 2021. It is now read-only.

Commit

Permalink
Merge pull request #14 from writeonly/scalapipeops
Browse files Browse the repository at this point in the history
ScapaPipeOps
  • Loading branch information
kamil-adam committed Apr 9, 2019
2 parents c6f56c8 + d7f17e9 commit 68c5aca
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ trait ScalaPipeOps {
implicit def toPipe[A](a: A): ScalaPipe[A] = ScalaPipe(a)

class ScalaPipe[A](a: A) {
def ||>[B](f: A => B): B = f(a)
def |>[B](f: A => B): B = f(a)
}

object ScalaPipe {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,11 @@ object ScalaPipeOptTest extends TestSuite {

override val tests: Tests = Tests {
'pipe_with_lambda - {
val result = 1 ||> (_ + 2)
val result = 1 |> (_ + 2)
result ==> 3
}
'pipe_with_method - {
val result = 1 ||> add2
val result = 1 |> add2
result ==> 3
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,11 @@ object ScalaPipeOptWithTraitTest extends TestSuite with ScalaPipeOps {

override val tests: Tests = Tests {
'into_with_lambda - {
val result = 1 ||> (_ + 2)
val result = 1 |> (_ + 2)
result ==> 3
}
'into_with_method - {
val result = 1 ||> add2
val result = 1 |> add2
result ==> 3
}
}
Expand Down

0 comments on commit 68c5aca

Please sign in to comment.