Skip to content

Instantly share code, notes, and snippets.

@lambdista
Created April 16, 2016 18:33
Show Gist options
  • Save lambdista/a210ca011b3c258611304f0c78b82563 to your computer and use it in GitHub Desktop.
Save lambdista/a210ca011b3c258611304f0c78b82563 to your computer and use it in GitHub Desktop.
Welcome to Scala 2.11.8 (Java HotSpot(TM) 64-Bit Server VM, Java 1.8.0_25).
Type in expressions for evaluation. Or try :help.
scala> import scala.language.higherKinds
import scala.language.higherKinds
scala> :paste
// Entering paste mode (ctrl-D to finish)
def foo[F[_], A](fa: F[A]): String = fa.toString
type IntConsumer[A] = Int => A
val f: IntConsumer[Int] = { x: Int => x * 2 }
foo(f)
// Exiting paste mode, now interpreting.
foo: [F[_], A](fa: F[A])String
defined type alias IntConsumer
f: IntConsumer[Int] = <function1>
res0: String = <function1>
scala>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment