Created
February 17, 2014 16:53
-
-
Save tkellogg/9054405 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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