cats with scala

cats with scala pdf epub mobi txt 電子書 下載2025

出版者:Underscore
作者:Noel Welsh
出品人:
頁數:327
译者:
出版時間:2017-11
價格:0
裝幀:平裝
isbn號碼:9781789533835
叢書系列:
圖書標籤:
  • 函數式編程
  • Scala
  • FP
  • Scala
  • 函數式編程
  • 類型類
  • 並發
  • Monad
  • Functor
  • Applicative
  • IO
  • 測試
  • 領域建模
想要找書就要到 小美書屋
立刻按 ctrl+D收藏本頁
你會得到大驚喜!!

具體描述

The main goal of this book is to teach system architecture and design using the techniques of modern functional programming. This means designing systems as small composable units, expressing constraints and interactions via the type system, and using composition to guide the construction of large systems in a way that maintains the original architectural vision.

The book also serves as an introduction to the Cats library. We use abstractions from Cats, and we explain the structure of Cats so you can use it without fear in your own code base. The broad ideas are not specific to Cats, but Cats provides an excellent implementation that is beneficial to learn in its own right.

Understand how to express abstractions using type classes.

Learn the key type classes of: Functor, Monoid, Applicative, and Monad.

Understand how to apply type classes to solve practical problems across a variety of domains.

To benefit from this book you should have about a year's experience with Scala, or equivalent experience with a functional language such as Haskell, O'Caml, or Lisp.

著者簡介

圖書目錄

Preface
Versions
Template Projects
Conventions Used in This Book
Typographical Conventions
Source Code
Callout Boxes
Acknowledgements
Backers
1 Introduction
1.1 Anatomy of a Type Class
1.1.1 The Type Class
1.1.2 Type Class Instances
1.1.3 Type Class Interfaces
1.2 Working with Implicits
1.2.1 Packaging Implicits
1.2.2 Implicit Scope
1.2.3 Recursive Implicit Resolution
1.3 Exercise: Printable Library
1.4 Meet Cats
1.4.1 Importing Type Classes
1.4.2 Importing Default Instances
1.4.3 Importing Interface Syntax
1.4.4 Importing All The Things!
1.4.5 Defining Custom Instances
1.4.6 Exercise: Cat Show
1.5 Example: Eq
1.5.1 Equality, Liberty, and Fraternity
1.5.2 Comparing Ints
1.5.3 Comparing Options
1.5.4 Comparing Custom Types
1.5.5 Exercise: Equality, Liberty, and Felinity
1.6 Controlling Instance Selection
1.6.1 Variance
1.7 Summary
2 Monoids and Semigroups
2.1 Definition of a Monoid
2.2 Definition of a Semigroup
2.3 Exercise: The Truth About Monoids
2.4 Exercise: All Set for Monoids
2.5 Monoids in Cats
2.5.1 The Monoid Type Class
2.5.2 Monoid Instances
2.5.3 Monoid Syntax
2.5.4 Exercise: Adding All The Things
2.6 Applications of Monoids
2.6.1 Big Data
2.6.2 Distributed Systems
2.6.3 Monoids in the Small
2.7 Summary
3 Functors
3.1 Examples of Functors
3.2 More Examples of Functors
3.3 Definition of a Functor
3.4 Aside: Higher Kinds and Type Constructors
3.5 Functors in Cats
3.5.1 The Functor Type Class
3.5.2 Functor Syntax
3.5.3 Instances for Custom Types
3.5.4 Exercise: Branching out with Functors
3.6 Contravariant and Invariant Functors
3.6.1 Contravariant Functors and the contramap Method
3.6.2 Invariant functors and the imap method
3.7 Contravariant and Invariant in Cats
3.7.1 Contravariant in Cats
3.7.2 Invariant in Cats
3.8 Aside: Partial Unification
3.8.1 Unifying Type Constructors
3.8.2 Left-to-Right Elimination
3.9 Summary
4 Monads
4.1 What is a Monad?
4.1.1 Definition of a Monad
4.1.2 Exercise: Getting Func-y
4.2 Monads in Cats
4.2.1 The Monad Type Class
4.2.2 Default Instances
4.2.3 Monad Syntax
4.3 The Identity Monad
4.3.1 Exercise: Monadic Secret Identities
4.4 Either
4.4.1 Left and Right Bias
4.4.2 Creating Instances
4.4.3 Transforming Eithers
4.4.4 Error Handling
4.4.5 Exercise: What is Best?
4.5 Aside: Error Handling and MonadError
4.5.1 The MonadError Type Class
4.5.2 Raising and Handling Errors
4.5.3 Instances of MonadError
4.5.4 Exercise: Abstracting
4.6 The Eval Monad
4.6.1 Eager, Lazy, Memoized, Oh My!
4.6.2 Eval’s Models of Evaluation
4.6.3 Eval as a Monad
4.6.4 Trampolining and Eval.defer
4.6.5 Exercise: Safer Folding using Eval
4.7 The Writer Monad
4.7.1 Creating and Unpacking Writers
4.7.2 Composing and Transforming Writers
4.7.3 Exercise: Show Your Working
4.8 The Reader Monad
4.8.1 Creating and Unpacking Readers
4.8.2 Composing Readers
4.8.3 Exercise: Hacking on Readers
4.8.4 When to Use Readers?
4.9 The State Monad
4.9.1 Creating and Unpacking State
4.9.2 Composing and Transforming State
4.9.3 Exercise: Post-Order Calculator
4.10 Defining Custom Monads
4.10.1 Exercise: Branching out Further with Monads
4.11 Summary
5 Monad Transformers
5.1 Exercise: Composing Monads
5.2 A Transformative Example
5.3 Monad Transformers in Cats
5.3.1 The Monad Transformer Classes
5.3.2 Building Monad Stacks
5.3.3 Constructing and Unpacking Instances
5.3.4 Default Instances
5.3.5 Usage Patterns
5.4 Exercise: Monads: Transform and Roll Out
5.5 Summary
6 Semigroupal and Applicative
6.1 Semigroupal
6.1.1 Joining Two Contexts
6.1.2 Joining Three or More Contexts
6.2 Apply Syntax
6.2.1 Fancy Functors and Apply Syntax
6.3 Semigroupal Applied to Different Types
6.3.1 Semigroupal Applied to Monads
6.4 Validated
6.4.1 Creating Instances of Validated
6.4.2 Combining Instances of Validated
6.4.3 Methods of Validated
6.4.4 Exercise: Form Validation
6.5 Apply and Applicative
6.5.1 The Hierarchy of Sequencing Type Classes
6.6 Summary
7 Foldable and Traverse
7.1 Foldable
7.1.1 Folds and Folding
7.1.2 Exercise: Reflecting on Folds
7.1.3 Exercise: Scaf-fold-ing Other Methods
7.1.4 Foldable in Cats
7.2 Traverse
7.2.1 Traversing with Futures
7.2.2 Traversing with Applicatives
7.2.3 Traverse in Cats
7.3 Summary
8 Case Study: Testing Asynchronous Code
8.1 Abstracting over Type Constructors
8.2 Abstracting over Monads
8.3 Summary
9 Case Study: Map-Reduce
9.1 Parallelizing map and fold
9.2 Implementing foldMap
9.3 Parallelising foldMap
9.3.1 Futures, Thread Pools, and ExecutionContexts
9.3.2 Dividing Work
9.3.3 Implementing parallelFoldMap
9.3.4 parallelFoldMap with more Cats
9.4 Summary
10 Case Study: Data Validation
10.1 Sketching the Library Structure
10.2 The Check Datatype
10.3 Basic Combinators
10.4 Transforming Data
10.4.1 Predicates
10.4.2 Checks
10.4.3 Recap
10.5 Kleislis
10.6 Summary
11 Case Study: CRDTs
11.1 Eventual Consistency
11.2 The GCounter
11.2.1 Simple Counters
11.2.2 GCounters
11.2.3 Exercise: GCounter Implementation
11.3 Generalisation
11.3.1 Implementation
11.3.2 Exercise: BoundedSemiLattice Instances
11.3.3 Exercise: Generic GCounter
11.4 Abstracting GCounter to a Type Class
11.5 Abstracting a Key Value Store
11.6 Summary
· · · · · · (收起)

讀後感

評分

評分

評分

評分

評分

用戶評價

评分

聚焦 higher kinded type & algebraic data type,具體到工程實踐,就是怎麼做拆解並行化,怎麼 F[G[_]] => G[F[_]],etc...(這本比紅書有兩大優勢:實用 & 寫作技巧高超深入淺齣

评分

神書 比小紅書更循序漸進

评分

聚焦 higher kinded type & algebraic data type,具體到工程實踐,就是怎麼做拆解並行化,怎麼 F[G[_]] => G[F[_]],etc...(這本比紅書有兩大優勢:實用 & 寫作技巧高超深入淺齣

评分

神書 比小紅書更循序漸進

评分

聚焦 higher kinded type & algebraic data type,具體到工程實踐,就是怎麼做拆解並行化,怎麼 F[G[_]] => G[F[_]],etc...(這本比紅書有兩大優勢:實用 & 寫作技巧高超深入淺齣

本站所有內容均為互聯網搜索引擎提供的公開搜索信息,本站不存儲任何數據與內容,任何內容與數據均與本站無關,如有需要請聯繫相關搜索引擎包括但不限於百度google,bing,sogou

© 2025 book.quotespace.org All Rights Reserved. 小美書屋 版权所有