Skip to content

Instantly share code, notes, and snippets.

Created September 2, 2013 23:17
Show Gist options
  • Save anonymous/6418105 to your computer and use it in GitHub Desktop.
Save anonymous/6418105 to your computer and use it in GitHub Desktop.
Why do Any and Nothing conform with * -> *?
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
@tonymorris
Copy link

Scala does not do kind polymorphism like a grown-up. Any and Nothing have every possible kind.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment