Files changed (9)
+ This is documentation being composed as I study scala and scalaz. Therefore a number of errors and omissions are likely. Hence it is at version 0.1. Your comments and suggestions are welcome and gratefully received. You can send them to dhananjay dot nene at gmail dot com.
+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 ::
+ *Scalaz is a library written in the Scala Programming Language. The intention of Scalaz is to include general functions that are not currently available in the core Scala API. The scalaz-core module depends only on the core Scala API and the core Java 2 Standard Edition API.*
+I think one of the parts the introduction above misses out on is that Scalaz is substantially influenced by Haskell types and attempts to carryover some of its features into scala. It goes without saying that `scalaz` is very strongly influenced towards functional programming constructs.
+The `scalaz` site is located at http://code.google.com/p/scalaz/. The source code repository is available at http://github.com/scalaz/scalaz.
+Make sure you have `git <http://git-scm.com/>`_ installed. If not you shall need to do download and install the same. Most linux versions should have the same available for install through the distribution's packaging system such as *apt* or *yum*. Alternative download and install the same as per instructions on the website.
+You will also need `sbt: the simple build tool for scala. <http://code.google.com/p/simple-build-tool/>`_ the scala build tool to be installed.
+Change your working directory (or `cd` into) the directory where you cloned or retrieved the scalaz code from github. (The directory will be called scalaz) ::
+`sbt` will compile/build `scalaz` and revert control to you in a prompt mode. (sample session shown below) ::
+ You may execute any project action or one of the commands described below. Only one action may be executed at a time in interactive mode and is entered by name, as it would be at the command line. Also, tab completion is available.
+ < file : Executes the commands in the given file. Each command should be on its own line. Empty lines and lines beginning with '#' are ignored
+ + <command> : Executes the project specified action or method for all versions of Scala defined in crossScalaVersions.
+ ++<version> <command> : Changes the version of Scala building the project and executes the provided command. <command> is optional.
+ reload : Reloads sbt, picking up modifications to sbt.version or scala.version and recompiling modified project definitions.
+ trace 'on', 'nosbt', 'off', or <integer> : Configures stack trace logging. 'nosbt' prints stack traces up to the first sbt frame. An integer gives the number of frames to show per exception.
+ console-project : Enters the Scala interpreter with the current project definition bound to the variable 'current' and all members imported.
+If you reach here, you've successfuly downloaded and built `scalaz` and now can use the same through the scala interpreter just launched. To exit the interpreter, just type *:quit* at the prompt.
+*The headers indicate the unicode symbol if any, followed by the ascii equivalent separated by a colon*
+Returns the dual of the value. Given a type A that has an instance of the Semigroup type class, the type Dual[A] has a Semigroup instance that reverses the arguments to Semigroup.append. In other words it is the dual of a monoid as obtained by swapping the arguments of `mappend`.
+.. todo:: had to deliberately force quotes & single quotes to work around pygments syntax highlighting issues. There is an important issue coming up. The output of the scala console (the one which starts with res0: etc) is not meeting pygments scala parser expectation - so the code highlighting is getting aborted. For now, I am modifying the output by introducing additional quotes and doublequotes to allow the parser to succeed. In the long term, either the scala console output should not get shown (which sucks!) or I shall need to hack the pygments scala parser to account for scala console output.
+Output the value converted to a string via shows to a destination specifically the console. The return is a `Unit` since the primary purpose is only the side effects
+.. todo:: had to deliberately force quotes & single quotes to work around pygments syntax highlighting issues
+Applies the function `(f: F[A => B])` over contents of a functor over type A `F[A]` to create a new functor of the same higher kind over type B `F[B]`
+`scalaz` supports a number of operators which are unicode characters. It also supports them through their ascii equivalents. The following table lists such operators, their unicode value, their digraphs (often used in keyboard mappings), their ascii equivalents,