Created
September 2, 2013 23:17
-
-
Save anonymous/6418105 to your computer and use it in GitHub Desktop.
Why do Any and Nothing conform with * -> *?
This file contains hidden or 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
scala> def foo[A[_]] = 1 | |
foo: [A[_]]=> Int | |
scala> foo[List] | |
res11: Int = 1 | |
scala> foo[Int] | |
<console>:24: error: Int takes no type parameters, expected: one | |
foo[Int] | |
^ | |
scala> foo[Any] | |
res13: Int = 1 | |
scala> foo[Nothing] | |
res14: Int = 1 | |
scala> wat |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Scala does not do kind polymorphism like a grown-up.
Any
andNothing
have every possible kind.