Scala api document in REPL

I am new to Scala programming and prefer to use code in a terminal other than eclipse, which seems to be very good. One thing that I still could not find is how to get api documents in Scala REPL (this is the command "w62>" or "sbt"), for example, the response of python or ipython to help () or put "?" at the end of the api respectively. Even Scala does not seem to have any command like “pydoc” for Python or “man” for C.

Is it true that the only way to find an api document is to view the document using a web form or am I missing?

+4
source share
1 answer

Is it true that the only way to find an api document is to view the document using a web form or am I missing?

This is indeed the case at the moment.

sbt sbt-man, .

> man Traversable /:
[man] scala.collection.Traversable
[man] def /:[B](z: B)(op: (B ⇒ A ⇒ B)): B
[man] Applies a binary operator to a start value and all elements of this
collection, going left to right. Note: /: is alternate syntax for foldLeft;
z /: xs is the same as xs foldLeft z. Note: will not terminate for infinite-
sized collections. Note: might return different results for different runs,
unless the underlying collection type is ordered. or the operator is
associative and commutative. 

doctrine.

$ doctrine "org.scala-lang" % "scala-library" % "2.11.2" -o ~/doc
[info] unzippped documents to /Users/foo/doc/scala-library-2.11.2-javadoc
+3

All Articles