Anybody read "Functional Programming in Scala", by Paul Chiusano and Rúnar Bjarnason?

1,023 views
Skip to first unread message

Alexandru Nedelcu

unread,
May 22, 2013, 4:14:12 AM5/22/13
to scala-user
Has anybody read "Functional Programming in Scala", by  Paul Chiusano and Rúnar Bjarnason?

It's available through Manning's early access program and was wondering what are your opinions on it: http://www.manning.com/bjarnason/

I'm only asking because I base my choices about what books to read based on reviews of other people and this being an unreleased book, Amazon doesn't have any good reviews for me :-(

Thanks,

Stefan Hoeck

unread,
May 22, 2013, 6:03:28 AM5/22/13
to scala...@googlegroups.com
I've worked through most of it and highly recommend it no matter whether you are a complete FP newbie or already familiar with all the cool abstractions provided by scalaz. The book does not only teach how to efficiently use the typical type classes like Monoids, Monads etc., but also how to go ahead and design your own purely functional libraries. It also has many exercises with solutions available online. Many are pretty basic and the solutions often are mere one-liners but there are also some quite tough ones.

It has only one drawback: There are not as many jokes and cute pictures as in Learn You A Haskell for Great Good. :o)

Cheers, Stefan

Julien Richard-Foy

unread,
May 22, 2013, 8:42:11 AM5/22/13
to scala...@googlegroups.com
Same as Stefan. I love this book.

Alexandru Nedelcu

unread,
May 22, 2013, 9:00:07 AM5/22/13
to Julien Richard-Foy, scala-user
Thanks guys, I guess I'll purchase it :-)


On Wed, May 22, 2013 at 3:42 PM, Julien Richard-Foy <juli...@gmail.com> wrote:
Same as Stefan. I love this book.

--
You received this message because you are subscribed to the Google Groups "scala-user" group.
To unsubscribe from this group and stop receiving emails from it, send an email to scala-user+...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
 
 



--
Alexandru Nedelcu
http://bionicspirit.com

pagoda_5b

unread,
May 22, 2013, 12:56:22 PM5/22/13
to scala...@googlegroups.com
I'm in the midst of the book and it's really worth buying.

It's especially useful since it's based on lots of exercises on the reader's part (which I highly recommend) that give you a hands-on familiarity with the chapter's content.
I also suggest verifying the solutions on the github repo made from the authors with the answers and chapter's code.
The offside is that progress can be slower than with other readings, since you need a pc with you to proceed.

Good reading,
Ivano

Alex Cruise

unread,
May 22, 2013, 2:01:30 PM5/22/13
to pagoda_5b, scala-user
I haven't read very much of it, but I've been impressed with the quality of the writing thus far.

-0xe1a


--

Edmondo Porcu

unread,
May 30, 2013, 5:38:58 AM5/30/13
to scala...@googlegroups.com

Certainly the most interesting book on Scala I have read for now

 

Good reading J

Edmondo

--

You received this message because you are subscribed to the Google Groups "scala-user" group.
To unsubscribe from this group and stop receiving emails from it, send an email to scala-user+...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

______________________________________________________________________
This email has been scanned by the Symantec Email Security.cloud service.
For more information please visit http://www.symanteccloud.com
______________________________________________________________________


______________________________________________________________________
This email has been scanned by the Symantec Email Security.cloud service.
For more information please visit http://www.symanteccloud.com
______________________________________________________________________

Alexandru Nedelcu

unread,
Jun 16, 2013, 2:52:20 PM6/16/13
to scala...@googlegroups.com
As a follow-up, I've started reading the book and I'm half-way through it. It's been a great experience so far.

Refreshing to see a book putting so much emphasis on exercises, when the trends seem to go in the other direction.

chelck

unread,
Jun 17, 2013, 9:05:24 PM6/17/13
to scala...@googlegroups.com
To each their own. I find the heavy reliance on exercises to be terribly annoying. I can't use the book as a reference and worse deep down I suspect the authors are even lazier than I am -- I don't want to do the exercises and they don't want to write the answers out. I hope they fix this because I feel there is a real need for a book that can take an imperative programmer deep into FP.

I concede they set themselves a very hard task. If they go too slow they'll loose the people with decent FP backgrounds, and if they go even moderately fast they'll lose Java guys like me. Seriously, I work long hours, I have young children, and I recently remarried. I don't have time to do exercises. Give me the facts, I'll try the stuff out at work and get feed back there.

Cheers

Rex Kerr

unread,
Jun 18, 2013, 12:37:03 AM6/18/13
to chelck, scala-user
I'm sympathetic to being busy, but I don't think you get exercises because authors are lazy.  It takes longer to write a good exercise than to pontificate.

Some things are best learned through exercises: those things where you don't need facts, you need skills.

Having "just the facts" about FP without actually doing it in depth (and exercises are a way to make sure you both do it at all and do a useful set of things) is about as useful as getting training in physics or math with "just the facts".  You may end up knowing facts, but you're not a physicist or mathematician.

That said, exercises are not what everyone likes to do, even if they are an effective and efficient way to learn the material.  If you're don't feel a good enough match to the pedagogical style of a teaching text, you're not likely to learn well from it even if it follows "good practices".  Motivation is hugely important in learning and memory, for instance, and there are ways other than exercises to get experience.

So while I don't think the "I'm busy, just the facts please" attitude is a fair criticism, "Exercises don't motivate me" is reason enough to motivate an alternate FP-for-the-Imperitively-Trained book.

  --Rex


--

Alexandru Nedelcu

unread,
Jun 18, 2013, 1:24:58 AM6/18/13
to chelck, scala-user
On Tue, Jun 18, 2013 at 4:05 AM, chelck <christop...@gmail.com> wrote:
I work long hours, I have young children, and I recently remarried.

Um, I'm also married, I also have a 3 year old boy and I also work a lot.

Coming up with really good exercises is an art. At the very least it takes a pedagogical education and training to do it. Not many people can do that. Also, for me good exercises are fun, like games / puzzles that need to be finished. Many times I choose to do that instead of watching a movie. In comparison with Real Work (tm) they don't have a deadline, they don't need testing, you don't have to please anybody else with the result and once you're done with one you get gratification.

Exercises are also essential for the learning of tough subjects. There is something to be said about our culture. We crave for instant gratification at all steps, in everything we do. Sometimes this attitude is hurting us.

For instance, in this book things get tough starting with Chapter 6 "Purely Functional State", where the State monad is presented. It is taught with a pretty cool example, a Random number generator, working gradually from a custom implementation to the general case, with the final exercise being for simulating a candy dispenser.

It's really difficult to grasp the concept of a State monad and how to work with it for imperative developers, because you're not transforming the actual state, rather you're writing combinators that describe your state transitions, as in functions that take as input other functions and return functions (i.e. you're working with higher-order functions, all the way down), being entirely different than anything an imperative developer ever did.

So you know, it's kind of useful to know that the type you're working with is a ... type State[S,+A] = S => (A,S)
But that doesn't mean much, does it? The real meat is in functions like map, flatMap, sequence, get, set and transform and how you work with those. And without implementing them by yourself, you simply won't get it.

--
Alexandru Nedelcu
https://bionicspirit.com

David Barri

unread,
Jun 18, 2013, 3:08:57 AM6/18/13
to scala...@googlegroups.com, chelck
I'm about halfway through and enjoying it so far. Mostly.

Before this book I would've agreed strongly that so much emphasis on exercises is detrimental but you know what? I read a bunch of sites and blog and presos on Scala + FP before I bought this book and I would say yep, yep, yep with each page, slide and code example, only to get to the end and realise, "Wait, I don't really get it." It's not something I'm used to. It's embarrassing.

I think FP has a legacy of seeing problems and solutions a certain way. In fact I think that's where the power of FP lies, and people like me who just want to blaze through the code and "get" it, aren't going to unless we get our hands dirty. Therefore, as much as I vehemently hate spending time writing throw-away code, I think the exercises are essential to us learning to see things from an FP perspective. I think without the exercises we wouldn't get much value from the book, although we'd think we would and probably dismiss FP. Or maybe that's just me.

Actually my criticism with the book is that the exercise instructions aren't clear enough. I find either them ambiguous and don't know exactly what is expected, or I solve the exercise problem in a completely different way. The code github has hint files but most are empty. :(


pagoda_5b

unread,
Jun 18, 2013, 5:17:58 AM6/18/13
to scala...@googlegroups.com
On Tuesday, June 18, 2013 3:05:24 AM UTC+2, chelck wrote:
To each their own. I find the heavy reliance on exercises to be terribly annoying. I can't use the book as a reference and worse deep down I suspect the authors are even lazier than I am -- I don't want to do the exercises and they don't want to write the answers out. I hope they fix this because I feel there is a real need for a book that can take an imperative programmer deep into FP.


I'd say that you're off-track my good friend,
have a look here and maybe you won't be troubled anymore:

enjoy 

I concede they set themselves a very hard task. If they go too slow they'll loose the people with decent FP backgrounds, and if they go even moderately fast they'll lose Java guys like me. Seriously, I work long hours, I have young children, and I recently remarried. I don't have time to do exercises. Give me the facts, I'll try the stuff out at work and get feed back there.


I'm married, have a day job, and a 3 week old baby, so I'm sympathetic to your condition and have my serious trouble finding the time to do the exercises, as you do. I tried skimming through a couple of chapters using the published solutions but I now find myself wanting to go back to re-read those, giving proper time to exercises to properly understand and really fix the concepts in my mind.

I think the exercises approach is impractical from a time-consuming point of view, but I really feel that I get more from this book than from others. It's like lectures and workshop mixed together.

bye,
Ivano

Rafał Krzewski

unread,
Jun 18, 2013, 5:57:01 AM6/18/13
to scala...@googlegroups.com, chelck
W dniu wtorek, 18 czerwca 2013 06:37:03 UTC+2 użytkownik Rex Kerr napisał:
I'm sympathetic to being busy, but I don't think you get exercises because authors are lazy.  It takes longer to write a good exercise than to pontificate.

Some things are best learned through exercises: those things where you don't need facts, you need skills.

I can't wait to get my hands of this book. I love the "learning by doing" approach. It's like physical exercise: if your muscles are not aching, you're not making progress :)

Cheers,
Rafał 

Chris Helck

unread,
Jun 18, 2013, 7:40:34 AM6/18/13
to Scala User Group
I will return to my studies. All of the encouragement is helpful. Just wish learning FP were a little easier. Perhaps it is easier in Haskell? It occurs to me that Scala's heavy use of implicits makes it hard for beginners to figure out how pieces come together. Until you really get it, it seems like magic. 

Christopher Helck

Marius Danciu

unread,
Jun 18, 2013, 8:14:57 AM6/18/13
to Chris Helck, Scala User Group
Some concepts could be easier understood in Haskell but then again if you want to use Scala you'll still have to understand Scala's "wizardry".


--
Reply all
Reply to author
Forward
0 new messages