Skip to content

Instantly share code, notes, and snippets.

@maowug
Forked from SteveGilham/gist:e9ef541553e09be75994
Created October 1, 2015 15:04
Show Gist options
  • Save maowug/51b8f593180078e76970 to your computer and use it in GitHub Desktop.
Save maowug/51b8f593180078e76970 to your computer and use it in GitHub Desktop.
package operator
object Functional {
class PipedObject[T] private[Functional] (value:T)
{
def |>[R] (f : T => R) = f(this.value)
}
implicit def toPiped[T] (value:T) = new PipedObject[T](value)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment