|
所在平台: Coursera |
课程主页: https://www.coursera.org/learn/scala-functional-program-design
课程评论:没有评论
课程名称:Scala中的函数式程序设计 概述:本课程将教授如何在大型Scala应用程序的设计中应用函数式编程风格。学习者将掌握若干重要的函数式编程概念,包括惰性计算和使用单子构建库的结构。课程将涉及更复杂的实例,如状态空间探索、随机测试和离散电路模拟器。同时,我们也会讨论如何在实际开发中编写出优质的Scala代码,学习如何利用编译器从类型中推断值。 多个部分将探讨函数式编程与可变状态之间的相互作用,研究将函数与状态结合的后果,并寻求使用无限数据结构或函数响应式编程作为可变状态的纯函数替代品。 推荐背景:建议至少具备一年编程经验,熟练掌握Java或C#最佳,但拥有C/C++、Python、Javascript或Ruby等其他语言经验也足够。学员应熟悉命令行使用。本课程适合在完成“Scala中的函数式编程原理”后进行学习:https://www.coursera.org/learn/progfun1。 大纲: 1. **for表达式与单子**:回顾函数式编程原理中的集合、模式匹配和函数,了解for-comprehensions的使用,探讨单子的概念及其规则。 2. **惰性计算**:解决组合搜索导致的性能问题,掌握惰性计算的重要性,并学习有关树的结构性归纳的证据。 3. **类型导向编程**:学习如何通过类型让编译器为我们编写程序,以及如何实现新的多态形式(类型类)。 4. **函数与状态**:研究状态和副作用,探讨管理大型程序状态的编程模式,学习Scala中的for循环和while循环。 5. **及时效果**:通过实例学习重要的编程模式,从观察者模式开始,然后学习函数响应式编程。
Name:For Expressions and Monads
Description:We'll start by revisiting some concepts that we have learned from Principles of Functional Programming in Scala; collections, pattern matching, and functions. We'll then touch on for-comprehensions, a powerful way in Scala to traverse a list, process it, and return a new list. We'll see how to do queries with for-comprehensions as well as how the for-comprehension is "desugared" into calls to higher-order functions by the Scala compiler. Finally, we'll discuss what monads are, and how to verify that the monad laws are satisfied for a number of examples.
Name:Lazy Evaluation
Description:This week we'll revisit performance issues caused by combinatorial search, and we'll discover an important concept in functional programming that can address these issues: laziness. We'll also learn a little bit about proofs on trees; in particular, we'll see how to extend structural induction to trees.
Name:Type-Directed Programming
Description:This week, we’ll learn how to make the compiler write programs for us! We’ll see how the compiler can summon program fragments based on their type and how this mechanism can be used to implement a new form of polymorphism (type classes).
Name:Functions and State
Description:This week, we'll learn about state and side-effects. Through a rich example, we'll learn programming patterns for managing state in larger programs. We'll also learn about for-loops and while-loops in Scala.
Name:Timely Effects
Description:This week we'll learn a number of important programming patterns via examples, starting with the observer pattern, and then going on to functional reactive programming.
In this course you will learn how to apply the functional programming style in the design of larger Scala applications. You'll get to know important new functional programming concepts, from lazy evaluation to structuring your libraries using monads. We'll work on larger and more involved examples, from state space exploration to random testing to discrete circuit simulators. You’ll also learn some best practices on how to write good Scala code in the real world. Finally, you will learn how to leverage the ability of the compiler to infer values from types. Several parts of this course deal with the question how functional programming interacts with mutable state. We will explore the consequences of combining functions and state. We will also look at purely functional alternatives to mutable state, using infinite data structures or functional reactive programming. Recommended background: You should have at least one year programming experience. Proficiency with Java or C# is ideal, but experience with other languages such as C/C++, Python, Javascript or Ruby is also sufficient. You should have some familiarity with using the command line. This course is intended to be taken after Functional Programming Principles in Scala: https://www.coursera.org/learn/progfun1.