scala/scala — pull request #2340 by folone (2013-03-31 16:13:58+00:00)
Title: Added a :kind command to the REPL

### Description
Because Scala supports working with higher kinded types, we might want to be able to inspects kinds as well as types. This pull request adds a simple `:kind` command, implemented by @eed3si9n in his ["Introduction to Scalaz: day 4"](http://eed3si9n.com/learning-scalaz-day3) post, to the Scala REPL. Here is an example output:
```scala
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
: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 *
```
### Future improvements
As pointed out by @retronym [here](https://twitter.com/retronym/status/318343952942125057), variance and type bounds are also part of the kind and we might want to include them in command's output.
### Acknowledgements
The function for `:kind` feature is originally implemented by @eed3si9n
I got a lot of help from @xeno-by and @retronym while working on this feature, thank you for that.

Happy Easter everyone!