Created
March 2, 2019 02:03
-
-
Save gvolpe/acf62ba1a15460579a60366d36f00d11 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
// (.) :: (b -> c) -> (a -> b) -> a -> c | |
implicit class FancyComposition[A, B, C](f: B => C) { | |
def `.`(g: A => B): A => C = f.compose(g) | |
} | |
val f: Int => String = _.toString | |
val g: String => Boolean = _.contains("1") | |
val h: Int => Boolean = g `.` f |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment