Skip to content

Instantly share code, notes, and snippets.

@akhileshs
Created February 23, 2018 07:07
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 akhileshs/3bd0e6ced38e3f6c06cdbae31ab27306 to your computer and use it in GitHub Desktop.
Save akhileshs/3bd0e6ced38e3f6c06cdbae31ab27306 to your computer and use it in GitHub Desktop.
@ def id[A](x: A): A = x
defined function id
@ def k[A, B](x: A, y: B): A = x
defined function k
@ def a[A, B](f: A => B, x: A): B = f(x)
defined function a
@ a((x: Int) => x + 1, 1)
res3: Int = 2
@ def t[A, B](x: A, f: A => B): B = f(x)
defined function t
@ def w[A, B](f: A => A => B, x: A): B = f(x)(x)
defined function w
@ def c[A, B, C](f: A => B => C, y: B, x: A): C = f(x)(y)
defined function c
@ def b[A, B, C](f: B => C, g: A => B, x: A): C = f(g(x))
defined function b
@ def s[A, B, C](f: A => B => C, g: A => B, x: A): C = f(x)(g(x))
defined function s
@ def p[A, B, C](f: B => B => C, g: A => B, x: A, y: A): C = f(g(x))(g(y))
defined function p
@ def y(f: ???, g: ???, x: ???): ??? = f((x: ???) => g(g)(x))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment