Skip to content

Instantly share code, notes, and snippets.

@folone
Last active December 15, 2015 12:39
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save folone/5261743 to your computer and use it in GitHub Desktop.
Save folone/5261743 to your computer and use it in GitHub Desktop.
:kind in scala repl (work in progress)
BUILD SUCCESSFUL
Total time: 9 minutes 21 seconds
Welcome to Scala version 2.11.0-20130329-204437-40d2981c24 (OpenJDK 64-Bit Server VM, Java 1.7.0_17).
Type in expressions to have them evaluated.
Type :help for more information.
scala> :kind scala.Option
Option's kind is * -> *
scala> :k scalaz.Unapply
Unapply's kind is ((* -> *) -> *) -> * -> *
scala> import scalaz._
import scalaz._
scala> :k Monad // Finds locally imported types.
Monad's kind is (* -> *) -> *
This is a type constructor that takes type constructor(s): a higher-kinded type.
scala> :k Nonexisting
<console>:14: error: not found: value Nonexisting
Nonexisting
^
scala> class Foo
defined class Foo
scala> new Foo { def empty = true }
res0: Foo{def empty: Boolean} = $anon$1@786aceba
scala> :k res0
Foo{def empty: Boolean}'s kind is *
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment