Source

scalaz-guide / initial.rst

Full commit

An initial overview of scalaz capabilities

We shall remain in the scala console mode (where we left off in the last chapter). If not in a console, get back to the scala console using sbt as suggested in the earlier chapter.

Much of the basic scalaz functionalities can be obtained by importing scalaz._ and Scalaz._ However, when running the console from within sbt, these are automatically imported. So the following is not required

scala> import scalaz._
import scalaz._

scala> import Scalaz._
import Scalaz._

scala>

At this stage the basic scalaz constructs are now available to the interpreter.

A pure is a simple trait which can take a value and constructs an applicative functor.

scala> 1.pure[Tuple1]
res0: (Int,) = (1)

scala> 1.pure[List]
res1: List[Int] = List(1)