This page is no longer maintained — Please continue to the home page at www.scala-lang.org

ghci :k counterpart for scala repl

3 replies
Amitava Shee
Joined: 2010-12-14,
User offline. Last seen 42 years 45 weeks ago.
Pardon me if this has been discussed before.

Is there a scala counterpart to the ghci :k command? e.g.

Prelude> :k []
[] :: * -> *

Thanks and Regards,
Amitava Shee
Doug Tangren
Joined: 2009-12-10,
User offline. Last seen 42 years 45 weeks ago.
Re: ghci :k counterpart for scala repl
Yes but you need to be using the 2.9 release candidate [1]. use the :type command. To see whats available type :help in your scala REPL.
scala> :type List()List[Nothing]
scala> :type ('a, 4)(Symbol, Int)
scala> val a = (n:Int) => n * 2a: (Int) => Int = <function1>
scala> :type a (Int) => Int

I didn't know this myself until you prompted the question. Thanks for inspiring me to download it and install it myself :)
[1]: http://www.scala-lang.org/downloads#RC
-Doug Tangren
http://lessis.me


On Fri, Apr 22, 2011 at 8:48 PM, Amitava Shee <amitava.shee@gmail.com> wrote:
Pardon me if this has been discussed before.

Is there a scala counterpart to the ghci :k command? e.g.

Prelude> :k []
[] :: * -> *

Thanks and Regards,
Amitava Shee

dcsobral
Joined: 2009-04-23,
User offline. Last seen 38 weeks 5 days ago.
Re: ghci :k counterpart for scala repl

Kind and type are not the same thing.

On Sat, Apr 23, 2011 at 18:21, Doug Tangren wrote:
> Yes but you need to be using the 2.9 release candidate [1]. use the :type
> command. To see whats available type :help in your scala REPL.
> scala> :type List()
> List[Nothing]
> scala> :type ('a, 4)
> (Symbol, Int)
> scala> val a = (n:Int) => n * 2
> a: (Int) => Int =
> scala> :type a
> (Int) => Int
>
> I didn't know this myself until you prompted the question. Thanks for
> inspiring me to download it and install it myself :)
> [1]: http://www.scala-lang.org/downloads#RC
> -Doug Tangren
> http://lessis.me
>
>
> On Fri, Apr 22, 2011 at 8:48 PM, Amitava Shee
> wrote:
>>
>> Pardon me if this has been discussed before.
>>
>> Is there a scala counterpart to the ghci :k command? e.g.
>>
>> Prelude> :k []
>> [] :: * -> *
>>
>> Thanks and Regards,
>> Amitava Shee
>
>

Doug Tangren
Joined: 2009-12-10,
User offline. Last seen 42 years 45 weeks ago.
Re: ghci :k counterpart for scala repl

-Doug Tangren
http://lessis.me


On Sat, Apr 23, 2011 at 6:54 PM, Daniel Sobral <dcsobral@gmail.com> wrote:
Kind and type are not the same thing.


I should have noted that I just starting picking up Haskell today :) Just trying to be friendly to people on the list. Sorry to mislead.

Copyright © 2012 École Polytechnique Fédérale de Lausanne (EPFL), Lausanne, Switzerland