Skip to content

Instantly share code, notes, and snippets.

@dsebban
Last active Feb 18, 2019
Embed
What would you like to do?
haskell flip in Scala
def flip[A,B,C]: (A => B => C) => (B => A => C) = f => x => y => f(y)(x)
def f: Int => String => Int= a => b => a + b.toInt
flip(f)("1")(2)
def ++ : String => String => String = a => b => a + b
flip(++)("Hello")("World")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment