Scala school
twitter.github.com
twitter.github.com
Also, the sbt they use in the tutorial is an old version; the community is going through a big shift to sbt 0.10 now, which is a totally different system. Very different, and often outright weird to the uninitiated, but worth learning if you're starting new projects.
This tutorial is for Scala 1.8.1, and 1.9.1 is available now and considered stable. Use it!
* "compose calls the second function and then the first function."
* "Maps - It can hold basic datatypes."
* "foldRight Is the same as foldLeft except it runs in the opposite direction."
I'd recommend friends to buy a good, well-edited book.
the scala school is mostly intended to be used in conjunction with a course we teach.
we're working on moving it towards being more self-contained, independent from the accompanying lectures.
2. Maps store mappings between keys and values.
3. Left and right folds both process a list recursively from start to end. However, left folds apply the given function first and then recurse. Right folds recurse first and then apply. As a result, in right folds the given function is applied to the last element first.
* "compose calls the second function and then the first function."
I would not call that wrong or inaccurate just very empty and not clear. What is the first function the left or right? Whatever the definition, it may as well be a tautology. If I was explaining composition I would explain it in a way that pulls from prior knowledge but also does not hamstring the learner.
In particular composition need not follow any particular direction. What matters in composition is in the ordering of the types, the outputs must fit the inputs. That is you can have f : B <- A and g : C <- B then h = f o g is a function from C <- A that is identical to a function formed by first applying f to its argument and piping that to g. Composition is a way of making new functions from old ones, kind of like multiplication for functions.
* "Maps - It can hold basic datatypes."
I don't know what that is supposed to mean. But Maps in functional languages tend to be immutable tree based key value data structures.
* "foldRight Is the same as foldLeft except it runs in the opposite direction."
This one is dangerous because it is true in a sense they are dual to each other. But applied indiscrimnately you could end up with different results unless operation with respect to the values is commutative and associative. remember the associative rule from school? Is 5 - (8 - 5) = (5 - 8) - 5? You can think of foldLeft as an accumulating a value and foldright as reducing to a value. foldRight is also less space efficient although you can write it in terms of foldl. However in a lazy language foldr has the additional distinction of being able to work with infinite lists since it works straight from the front of the list, it doesn't have to recurse to the end of the list first like foldl.
scala> val timesTwo = multiply(2)(_)
This should just be multiply(2). Using an underscore misses the point of a curried function. f(_)==f..
But no mention of Actors or Akka in the concurrency section? Why not, out of curiosity? Actor model doesn't fit your use cases?
There's some people at Twitter who truly love and grok Scala and Scala idioms inside out, and there's some people who look at Scala as a more functional, less verbose Java.
>There's some people at Twitter who truly love and grok Scala and Scala idioms inside out, and there's some people who look at Scala as a more functional, less verbose Java.
I'm a full card-carrying member of exactly both groups, but if all Scala does is succeed b/c of the latter, it will have served a wonderful purpose in displacing Java.
This makes no sense; people who have experience with FP concepts don't need to know that, and those who don't won't be able to understand what you're talking about. Saying things like "I promise, this will get easier over time" isn't actually helpful.
Also, the text is low-contrast and difficult to read.
http://blog.typesafe.com/free-pdf-from-typesafe-scala-for-th...
Unfortunately it's not for the actually impatient since only the first 9(?) chapters are released and the more interesting ones probably won't be available until late this or early next year, so you'll need to augment it with another book for now.
https://github.com/leithaus/XTrace/tree/8498f3294c8e8e52fe52...
I haven't seen this book, the review war is unfortunate, but the one 4-star review seems credible
http://www.amazon.com/Steps-Scala-Introduction-Object-Functi...
EDIT: Not to mention there are places that could use some copy editing...