Created
April 16, 2016 18:33
-
-
Save lambdista/a210ca011b3c258611304f0c78b82563 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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