Skip to content

Instantly share code, notes, and snippets.

@tkellogg
Created February 17, 2014 16:53
Show Gist options
  • Save tkellogg/9054405 to your computer and use it in GitHub Desktop.
Save tkellogg/9054405 to your computer and use it in GitHub Desktop.
implicit class BecauseFsharp[T](obj: T) {
/**
* This comes from OCaml/F#; very handy when used with partial function
* application. It's mainly useful for reducing parenthesis nesting.
*
* `foo(bar)` is same as `bar |> foo`
*/
@inline def |>[U](function: T => U): U = function(obj)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment