Skip to content

Instantly share code, notes, and snippets.

@dsebban
Last active February 18, 2019 07:59
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dsebban/ff9e7374c86b00f712c6f63a31b3115d to your computer and use it in GitHub Desktop.
Save dsebban/ff9e7374c86b00f712c6f63a31b3115d to your computer and use it in GitHub Desktop.
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