implicit final class AnySyntax[A] extends AnyVal
Linear Supertypes
Ordering
- Alphabetic
- By Inheritance
Inherited
- AnySyntax
- AnyVal
- Any
- Hide All
- Show All
Visibility
- Public
- Protected
Instance Constructors
- new AnySyntax(a: A)
Value Members
- def getClass(): Class[_ <: AnyVal]
- Definition Classes
- AnyVal → Any
- def ignore: Unit
- Annotations
- @silent("side-effecting nullary methods are discouraged")
- def tap(f: (A) => Any): A
Applies the function
f
to the valuea
, ignores the result, and returns the original valuea
.Applies the function
f
to the valuea
, ignores the result, and returns the original valuea
. Practical for debugging, likex.someMethod.tee(println(_)).someOtherMethod...
. Similar to thetee
UNIX command. - def |>[B](f: (A) => B): B
Applies function
f
to a valuea
, likef(a)
, but in flipped order and doesn't need parentheses.Applies function
f
to a valuea
, likef(a)
, but in flipped order and doesn't need parentheses. Can be chained, likex |> f |> g
.