Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
f1 x y = x - y
f2 x y = (-) x y
f3 x = (-) x
f4 = (-)
g1 x = f4 2 x
g2 = f4 2
main = do
print $ g2 5
val add: Int => Int => Int = x => y => x + y
println(add(1)(2))
def add1(x: Int): Int = add(1)(x)
println(add1(1))
def add2 = add(1)
println(add2(4))
def f1(x: Int, y: Int): Int = x - y
def f2(x: Int): Int = f1(3, x)
def f3 = f1(3, _:Int)
def f4 = f1(_:Int, _:Int)
println(f1(3, 2))
println(f2(2))
println(f3(2))
println(f4(3, 2))
def g1(x: Int): Int = f4(2, x)
def g2 = f4(2, _:Int)
println(g1(5))
println(g2(5))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment