I am trying to dig scala deeper but scaladocs is not straight as javadocs. While doing some mathematical operation I visited to scala.math here package. I am not able to understand value member in the docs.please suggest some guide line to decipher scaladocs. It may be a silly question but as a newbie please suggest something.
2 Answers
See http://www.scala-lang.org/docu/files/packageobjects/packageobjects.html:
Any kind of definition that you can put inside a class, you can also put at the top level of a package. If you have some helper method you'd like to be in scope for an entire package, go ahead and put it right at the top level of the package
To do so, put the definitions in a package object. Each package is allowed to have one package object.
So - the Scaladoc for scala.math
package divides members of this package to Type Members (classes, just like in Java) and Value Members (object
s, def
s, val
s and var
s). You can see these members in the source code at scala/math/package.scala.

- 1
- 1

- 37,442
- 3
- 79
- 85
-
Objects are value members, not type members. – sepp2k Aug 13 '16 at 11:33
package object A {
case class B(i: Int)
Type Stb = String => Boolean
val s: String = "A"
val b: Boolean = false
val f: (String => Boolean) = s => s.isEmpty
def d(s: String): Boolean = s.isEmpty
}
In this package all member classes and Types
are Type
members, vals
and def
s are value
members.

- 13,738
- 28
- 47
-
-
The same goes for package. In Scala there is a concept of a package object. – sarveshseri Aug 13 '16 at 08:11