Functional programming (FP) is a programming style emphasizing functions that return consistent and predictable results regardless of a program's state. As a result, functional code is easier to test and reuse, simpler to parallelize, and less prone to bugs. Scala is an emerging JVM language that offers strong support for FP. Its familiar syntax and transparent interoperability...
Functional programming (FP) is a programming style emphasizing functions that return consistent and predictable results regardless of a program's state. As a result, functional code is easier to test and reuse, simpler to parallelize, and less prone to bugs. Scala is an emerging JVM language that offers strong support for FP. Its familiar syntax and transparent interoperability with existing Java libraries make Scala a great place to start learning FP.
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.
You'll discover simple but powerful ideas and techniques that cut through the complexity of modern software engineering, including writing multi-core and distributed programs. You'll learn how FP gives you high confidence in the correctness of your code and helps you design software at high levels of abstraction so that even very large systems become comprehensible at a glance.
WHAT'S INSIDE:
Functional programming from square one in clear, readable language
No prior Scala experience needed
Learn both the hows and whys of FP
No prior experience with FP or Scala is required. Perfect for programmers familiar with FP in other languages wishing to apply their knowledge in Scala.
作者简介
· · · · · ·
Paul Chiusano and Rúnar Bjarnason are recognized experts in functional programming with Scala. Each has been writing Scala and using FP professionally for several years. Paul is a Scalaz contributor, blogs and speaks regularly on Scala and FP. Rúnar is a principal contributor to Scalaz and the Functional Java library and has been using and teaching FP since 2008.
目录
· · · · · ·
PART 1: INTRODUCTION TO FUNCTIONAL PROGRAMMING
1. What is functional programming? - FREE
2. Structuring functional programs - AVAILABLE
3. Functional data structures - AVAILABLE
4. Handling errors without exceptions - AVAILABLE
5. Strictness and laziness - AVAILABLE
· · · · · ·
(更多)
PART 1: INTRODUCTION TO FUNCTIONAL PROGRAMMING
1. What is functional programming? - FREE
2. Structuring functional programs - AVAILABLE
3. Functional data structures - AVAILABLE
4. Handling errors without exceptions - AVAILABLE
5. Strictness and laziness - AVAILABLE
6. Purely functional state - AVAILABLE
PART 2: FUNCTIONAL DESIGN AND COMBINATOR LIBRARIES
7. Purely functional parallelism - AVAILABLE
8. Property-based testing - AVAILABLE
9. Parser combinators
PART 3: COMMON STRUCTURES IN FUNCTIONAL DESIGN
10. Monoids
11. Monads
12. Applicative functors, traversable, and distributive data structures
PART 4: BREAKING THE RULES: EFFECTS AND I/O
13. External effects and I/O
14. Local effects and the ST monad
15. Stream processing and incremental I/O
Appendix A: Haskell, Scala and syntax
Appendix B: Scalaz, implicits, and large library organization
· · · · · · (收起)
Note that even an expression like 2 + 1 is just calling a member of an object. In
that case, what we’re calling is the + member of the object 2. It’s really syntactic sugar
for the expression 2.+(1), which passes 1 as an argument to the method + on the
object 2. Scala has no special notion of operators. It’s simply the case that + is a valid
method name in Scala. Any method name can be used infix like that (omitting the
dot and parentheses) when calling it with a single argument. For example, instead of
MyModule.abs(42) we can say MyModule abs 42 and get the same result. You can use
whichever you find more pleasing in any given case. (查看原文)
译者对原文的翻译并没有遵照原文的顺序,腾挪转移、移花接木、添油加醋,也许译者有自己的考量,姑且不论好坏。但是这一章的翻译整章都似是而非甚至前后矛盾,这就有点说不过去了。 【1】P167 {原文}:Monads provide a very powerful interface, as evidenced by the fact th...
(展开)
1 有用 不青山 2017-07-30 13:01:58
大开眼界!很棒的函数式编程入门书。我的笔记:http://facaiy.github.io/tech/2017/04/23/Functional-Programming-in-Scala.html
2 有用 lhzbxx 2019-05-27 22:57:20
本书重点在于 Functional Programming,而 scala 更像是顺带一提(PL 中的工具人)。书中的习题相当烧脑,对 FP 思维方式的锻炼很有帮助。 Scala 整体的语言表达力犀利,虽然有瑕疵,但足够体验到 FP 的神奇之处。当你深刻理解 Functor、Applicative、Monad,并落地在应用中,你会看到一个完全不同的世界。在这个世界中,不止是表面上的酷炫——所有的规... 本书重点在于 Functional Programming,而 scala 更像是顺带一提(PL 中的工具人)。书中的习题相当烧脑,对 FP 思维方式的锻炼很有帮助。 Scala 整体的语言表达力犀利,虽然有瑕疵,但足够体验到 FP 的神奇之处。当你深刻理解 Functor、Applicative、Monad,并落地在应用中,你会看到一个完全不同的世界。在这个世界中,不止是表面上的酷炫——所有的规则都是代数的、可严格推导的,因此抽象出的原语是如此的简洁而美妙、纯粹而强悍,与人类的认知建立起一道漂亮而牢固的桥梁。 再读《Functional and Reactive Domain Modeling》或许会有更深刻的体会。 (展开)
0 有用 greylancer 2016-02-16 17:48:17
看了前几章,暂停;scala还是偏复杂
3 有用 masque 2014-09-17 02:07:44
functional programming的标杆之作 。最赞的是,全部付有习题和解答,以及源代码(github上放着)
0 有用 Lo 2021-01-03 14:00:59
Needs revisiting
0 有用 SakamataZ 2022-09-24 08:47:00 浙江
比Coursera上那节sml+racket的课要好
0 有用 罗吉 2021-09-18 11:09:46
一本学会fp!
0 有用 一葉 2021-01-30 16:36:08
真好,真难
0 有用 Lo 2021-01-03 14:00:59
Needs revisiting
0 有用 Z.Y. 2020-04-14 11:40:11
红宝书,常拿出来读一读,久读久新