HN Books @HNBooksMonth

The best books of Hacker News.

Hacker News Comments on
Functional Programming in Scala

Paul Chiusano, Rúnar Bjarnason · 5 HN comments
HN Books has aggregated all Hacker News stories and comments that mention "Functional Programming in Scala" by Paul Chiusano, Rúnar Bjarnason.
View on Amazon [↗]
HN Books may receive an affiliate commission when you make purchases on sites after clicking through links on this page.
Amazon Summary
Summary Functional Programming in Scala is a serious tutorial for programmers looking to learn FP and apply it to the everyday business of coding. The book guides readers from basic techniques to advanced topics in a logical, concise, and clear progression. In it, you'll find concrete examples and exercises that open up the world of functional programming. Purchase of the print book includes a free eBook in PDF, Kindle, and ePub formats from Manning Publications. About the Technology Functional programming (FP) is a style of software development emphasizing functions that don't depend on program state. Functional code is easier to test and reuse, simpler to parallelize, and less prone to bugs than other code. Scala is an emerging JVM language that offers strong support for FP. Its familiar syntax and transparent interoperability with Java make Scala a great place to start learning FP. About the Book Functional Programming in Scala is a serious tutorial for programmers looking to learn FP and apply it to their everyday work. The book guides readers from basic techniques to advanced topics in a logical, concise, and clear progression. In it, you'll find concrete examples and exercises that open up the world of functional programming. This book assumes no prior experience with functional programming. Some prior exposure to Scala or Java is helpful. What's Inside Functional programming concepts The whys and hows of FP How to write multicore programs Exercises and checks for understanding About the Authors Paul Chiusano and Rúnar Bjarnason are recognized experts in functional programming with Scala and are core contributors to the Scalaz library. Table of Contents PART 1 INTRODUCTION TO FUNCTIONAL PROGRAMMING What is functional programming? Getting started with functional programming in Scala Functional data structures Handling errors without exceptions Strictness and laziness Purely functional state PART 2 FUNCTIONAL DESIGN AND COMBINATOR LIBRARIES Purely functional parallelism Property-based testing Parser combinators PART 3 COMMON STRUCTURES IN FUNCTIONAL DESIGN Monoids Monads Applicative and traversable functors PART 4 EFFECTS AND I/O External effects and I/O Local effects and mutable state Stream processing and incremental I/O
HN Books Rankings

Hacker News Stories and Comments

All the comments and stories posted to Hacker News that reference this book.
I actually read a book on Functional Programming in Scala [0] as my introduction to FP, so I had a little understanding of concepts in functional programming already, but in terms of just Haskell my recommendation would be that Get Programming with Haskell book by Will Kurt that I mentioned, which is targeted at beginners. Someone else added the Learn You a Haskell Book for Great Good! book online which is a good free online source as well, but since the original version was written in 2011, it might be a few versions behind on the GHC compiler compared to the Kurt book which was released in 2019.

After going through an introductory resource to learn syntax and concepts, other good beginner resources I have used are the Functional Programming Discord [1], the free Data61 course that Brian McKenna goes over [2], and the Tsoding series on YouTube [3]. The Practical Haskell book I mentioned is good too, but I found it a bit higher level than these other resources.

[0]: https://www.amazon.com/Functional-Programming-Scala-Paul-Chi...

[1]: https://discordapp.com/invite/FvT2Y5N

[2]: https://www.youtube.com/watch?v=NzIZzvbplSM

[3]: https://www.youtube.com/watch?v=h_D4P-KRNKs

I found Functional Programming in Scala to be the best source: https://www.amazon.com/Functional-Programming-Scala-Paul-Chi...
bontoJR
That book is by far the best one I ever read about Functional Programming in general, even if you don't want to learn Scala itself it is an amazing reading about FP.
jibitesh
+1 for this The best book for how to use Scala. It talks about not just how to use FP, but also why to do it and the best practices.
montik
+1 amazing book! A lot of FP ideas and how these apply to real world situations!
nrinaudo
I would say that rather depends on what OP means by "properly".

If OP already knows Scala and would like to get better at it and one assumes that "Scala as Haskell in the JVM" is more desirable than "Scala as a better Java", then yes, that's a great suggestion.

If OP wants to learn Scala from the ground up, I disagree pretty strongly with starting there. It's a great book, well written, with a wealth of challenging and mind-opening exercises, but I wouldn't recommend that as anyone's first exposure to the language. The second or third, sure, but it purposefully restricts itself to what its authors consider a sane subset of the language.

I happen to agree with their definition, but, in my experience, knowing a programming language is about reading it as well as writing it, and by restricting your learning to a subset of the language, you'll find yourself unable to understand perfectly valid, normal code - code that is part of the standard library, for instance.

I would rather suggest reading Odersky's book while allowing oneself to skip large chunks that go rather in too much details about fairly useless things like the XML API. Or going through scala-exercises (https://www.scala-exercises.org). Or the coursera class - its first incarnation was pretty good, I assume the new one is at least of the same caliber. They might not make you an expert overnight, but they'll get you to know most of the Scala features you're likely to encounter in the wild, and to be able to read and learn from most Scala OSS projects.

SatvikBeri
I actually learned Scala from this book, and the only languages I had used in production before were Python and Fortran. I don't think learning the functional subset first made it harder for me to learn the object-oriented and imperative parts later on. Plus, understanding the functional subset gives you a better understanding of many of the internals, such as what `for` comprehensions are actually doing.

Of course, if you just read one book and stop there, I'd agree. But most people will continue learning from tutorials, videos, stackoverflow, etc.

I've also seen several other people learn Scala this way, usually without knowing any functional programming before, and really haven't seen any signs of issues wrt not understanding code written in other styles.

Functional Programming in Scala would be my suggestion:

http://www.amazon.com/Functional-Programming-Scala-Paul-Chiu...

I would consider it an updated and more practically minded version of SICP, which is of course amazing as well but not the sort of book you asked for.

Have you read the canonical Functional Programming in Scala? It goes over all of that and more in immense detail.

http://www.amazon.com/Functional-Programming-Scala-Paul-Chiu...

HN Books is an independent project and is not operated by Y Combinator or Amazon.com.
~ yaj@
;laksdfhjdhksalkfj more things
yahnd.com ~ Privacy Policy ~
Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.