- About Scala
- Documentation
- Code Examples
- Software
- Scala Developers
ghci :k counterpart for scala repl
Sat, 2011-04-23, 01:48
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
Is there a scala counterpart to the ghci :k command? e.g.
Prelude> :k []
[] :: * -> *
Thanks and Regards,
Amitava Shee
Sat, 2011-04-23, 23:57
#2
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
>
>
Sun, 2011-04-24, 00:47
#3
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.
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: