Skip to content

Instantly share code, notes, and snippets.

@szeiger
Last active May 16, 2018 13:58
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save szeiger/3a2e7e65b641bac9764a9c02de233ab9 to your computer and use it in GitHub Desktop.
Save szeiger/3a2e7e65b641bac9764a9c02de233ab9 to your computer and use it in GitHub Desktop.
Kind-polymorphic Any and Nothing
scala> def f[C[_], E]: List[C[E]] = Nil
warning: there was one feature warning; re-run with -feature for details
f: [C[_], E]=> List[C[E]]
scala> f[List, Int]
res5: List[List[Int]] = List()
scala> f[Any, Int]
res6: List[Any] = List()
scala> f[Nothing, Int]
res7: List[Nothing] = List()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment