|
所在平台: Udemy |
课程主页: https://www.udemy.com/course/functional-effect-handling-in-scala-with-cats-effect/
课程评论:没有评论
课程名称:Scala 中的功能性效果处理与 Cats Effect 课程概述:当你第一次听说功能性编程(FP)时,可能会觉得它只能用于简单的示例或非常学术的目的。毕竟,功能性编程的核心在于纯粹性,而程序中几乎所有有用的操作都是不纯的,例如 HTTP 调用、文件 IO 等。在本课程中,我将向你展示功能性编程实际上非常适合处理效果。通过将程序的描述与执行分离,你可以构建易于组合和推理的计算,同时保留副作用的所有实用性。 为此,我们将使用出色的 Cats Effect 库,该库提供了一个 IO 单子来建模我们的效果,拥有丰富的 API 来组合这些效果,并且提供高性能的运行时来执行它们。课程分为多个小型和中型部分,每个部分关注一个特定主题。在每一部分的末尾都有一个最终练习,帮助你巩固所学内容,并有一个测验来检查你的回忆和理解。 到课程结束时,你将能够: - 编写和组合你想要运行的计算,且在实际运行之前完成。 - 针对你的应用程序设计错误处理策略,同时考虑副作用。 - 增加程序的并行性和并发性,而无需处理底层细节。 - 以优雅的方式使用和组合需要释放的资源(连接、IO 流等)。 - 使用纯功能性原语处理涉及并发共享状态和线程通信的复杂场景。 希望你在学习的过程中也能感到乐趣!
When you first hear about functional programming you might get the impression that it can only be used in toy examples or for very academic purposes. After all, FP is all about purity and almost every useful thing you can do in a program is impure: http calls, file IO, and so on.In this course I'm going to show you that FP is actually amazing for dealing with effects. By separating program description from execution you will be able to build computations that are easy to compose and reason about, while at the same time keeping all the usefulness of side-effects.In order to do so, we are going to use the amazing Cats Effect library, which provides an IO monad to model our effects, a very rich API to compose them, and a highly-performant runtime to execute them.The course is structured in many small/medium sized sections that focus on one specific topic. At the end of each section there is a final exercise to practice what you learned, and a quiz to help check your recall and understanding of the section.By the end of the course, you will be able to:Write and compose computations you want to run, before actually running them.Design an error handling strategy for your application, taking side-effects into consideration.Increase the parallelism and concurrency of your programs without the need to handle low-level details.Use and compose resources that need to be released (connections, io streams, etc.) in an elegant manner.Handle complex scenarios involving concurent shared state and thread communication by using purely functional primitives.Hopefully, you will also have some fun along way!