Scala with Cats
Book information
Description
Preface Versions Template Projects Conventions Used in This Book Typographical Conventions Source Code Callout Boxes Acknowledgements Backers I Theory Introduction Anatomy of a Type Class The Type Class Type Class Instances Type Class Use Working with Implicits Packaging Implicits Implicit Scope Recursive Implicit Resolution Exercise: Printable Library Meet Cats Importing Type Classes Importing Default Instances Importing Interface Syntax Importing All The Things! Defining Custom Instances Exercise: Cat Show Example: Eq Equality, Liberty, and Fraternity Comparing Ints Comparing Options Comparing Custom Types Exercise: Equality, Liberty, and Felinity Controlling Instance Selection Variance Summary Monoids and Semigroups Definition of a Monoid Definition of a Semigroup Exercise: The Truth About Monoids Exercise: All Set for Monoids Monoids in Cats The Monoid Type Class Monoid Instances Monoid Syntax Exercise: Adding All The Things Applications of Monoids Big Data Distributed Systems Monoids in the Small Summary Functors Examples of Functors More Examples of Functors Definition of a Functor Aside: Higher Kinds and Type Constructors Functors in Cats The Functor Type Class and Instances Functor Syntax Instances for Custom Types Exercise: Branching out with Functors Contravariant and Invariant Functors Contravariant Functors and the contramap Method Invariant functors and the imap method Contravariant and Invariant in Cats Contravariant in Cats Invariant in Cats Aside: Partial Unification Limitations of Partial Unification Summary Monads What is a Monad? Definition of a Monad Exercise: Getting Func-y Monads in Cats The Monad Type Class Default Instances Monad Syntax The Identity Monad Exercise: Monadic Secret Identities Either Left and Right Bias Creating Instances Transforming Eithers Error Handling Exercise: What is Best? Aside: Error Handling and MonadError The MonadError Type Class Raising and Handling Errors Instances of MonadError Exercise: Abstracting The Eval Monad Eager, Lazy, Memoized, Oh My! Eval's Models of Evaluation Eval as a Monad Trampolining and Eval.defer Exercise: Safer Folding using Eval The Writer Monad Creating and Unpacking Writers Composing and Transforming Writers Exercise: Show Your Working The Reader Monad Creating and Unpacking Readers Composing Readers Exercise: Hacking on Readers When to Use Readers? The State Monad Creating and Unpacking State Composing and Transforming State Exercise: Post-Order Calculator Defining Custom Monads Exercise: Branching out Further with Monads Summary Monad Transformers Exercise: Composing Monads A Transformative Example Monad Transformers in Cats The Monad Transformer Classes Building Monad Stacks Constructing and Unpacking Instances Default Instances Usage Patterns Exercise: Monads: Transform and Roll Out Summary Semigroupal and Applicative Semigroupal Joining Two Contexts Joining Three or More Contexts Semigroupal Laws Apply Syntax Fancy Functors and Apply Syntax Semigroupal Applied to Different Types Semigroupal Applied to Monads Parallel Apply and Applicative The Hierarchy of Sequencing Type Classes Summary Foldable and Traverse Foldable Folds and Folding Exercise: Reflecting on Folds Exercise: Scaf-fold-ing Other Methods Foldable in Cats Traverse Traversing with Futures Traversing with Applicatives Traverse in Cats Summary II Case Studies Case Study: Testing Asynchronous Code Abstracting over Type Constructors Abstracting over Monads Summary Case Study: Map-Reduce Parallelizing map and fold Implementing foldMap Parallelising foldMap Futures, Thread Pools, and ExecutionContexts Dividing Work Implementing parallelFoldMap parallelFoldMap with more Cats Summary Case Study: Data Validation Sketching the Library Structure The Check Datatype Basic Combinators Transforming Data Predicates Checks Recap Kleislis Summary Case Study: CRDTs Eventual Consistency The GCounter Simple Counters GCounters Exercise: GCounter Implementation Generalisation Implementation Exercise: BoundedSemiLattice Instances Exercise: Generic GCounter Abstracting GCounter to a Type Class Abstracting a Key Value Store Summary III Solutions to Exercises Solutions for: Introduction Printable Library Printable Library Part 2 Printable Library Part 3 Cat Show Equality, Liberty, and Felinity Solutions for: Monoids and Semigroups The Truth About Monoids All Set for Monoids Adding All The Things Adding All The Things Part 2 Adding All The Things Part 3 Solutions for: Functors Branching out with Functors Showing off with Contramap Showing off with Contramap Part 2 Transformative Thinking with imap Transformative Thinking with imap Part 2 Transformative Thinking with imap Part 3 Solutions for: Monads Getting Func-y Monadic Secret Identities What is Best? Abstracting Safer Folding using Eval Show Your Working Hacking on Readers Hacking on Readers Part 2 Hacking on Readers Part 3 Post-Order Calculator Post-Order Calculator Part 2 Post-Order Calculator Part 3 Branching out Further with Monads Solutions for: Monad Transformers Monads: Transform and Roll Out Monads: Transform and Roll Out Part 2 Monads: Transform and Roll Out Part 3 Monads: Transform and Roll Out Part 4 Solutions for: Semigroupal and Applicative The Product of Lists Parallel List Solutions for: Foldable and Traverse Reflecting on Folds Scaf-fold-ing Other Methods Traversing with Vectors Traversing with Vectors Part 2 Traversing with Options Traversing with Validated Solutions for: Case Study: Testing Asynchronous Code Abstracting over Type Constructors Abstracting over Type Constructors Part 2 Abstracting over Monads Abstracting over Monads Part 2 Solutions for: Case Study: Map-Reduce Implementing foldMap Implementing foldMap Part 2 Implementing parallelFoldMap parallelFoldMap with more Cats Solutions for: Case Study: Data Validation Basic Combinators Basic Combinators Part 2 Basic Combinators Part 3 Basic Combinators Part 4 Basic Combinators Part 5 Checks Checks Part 2 Checks Part 3 Recap Recap Part 2 Kleislis Kleislis Part 2 Solutions for: Case Study: CRDTs GCounter Implementation BoundedSemiLattice Instances Generic GCounter Abstracting GCounter to a Type Class Abstracting a Key Value Store
Similar books
Scala with Cats
2020 · EPUB
MySQL® Notes for Professionals book
2018 · PDF
MrExcel 2022: Boosting Excel
2022 · PDF
MrExcel 2022: Boosting Excel
2022 · PDF
Session C11: Ancient Cultural Landscapes in South Europe – their Ecological Setting and Evolution, Session C22: Gardeners from South America, Session S04: Agro-Pastoralism and Early Metallurgy Sessions, Session WS29: The Idea of Enclosure in Recent Iberian Prehistory, Session C88: Rhytmes et causalites des dynamiques de l'anthropisation en Europe entre 6500 ET 500 BC: Hypotheses socio-culturelles et/ou climatiques: Proceedings of the XV UISPP World Congress (Lisbon 4-9 September 2006) / Actes du XV Congrès Mondial (Lisbonne 4-9 Septembre 2006) Vol.36
2010 · PDF
THE BRITISH ARMY IN INDIA: ITS PRESERVATION BY AN APPROPRIATE CLOTHING, HOUSING, LOCATING, RECREATIVE EMPLOYMENT, AND HOPEFUL ENCOURAGEMENT OF THE TROOPS. with AN APPENDIX ON INDIA : THE CLIMATE OP ITS HILLS ; THE DEVELOPMENT OF ITS RESODRCBS, INDUSTRY, AND ARTS ; THE ADMINISTRATION OF JUSTICE ; THE BLACK ACT ; THE PROGRESS OF CHRISTIANITY ; THE TRAFFIC IN OPIUM ; THE VALUE OF INDIA ; PERMANENT CAUSES OF DISAFFECTION, AND OF THE RECENT REBELLION ; THE TRADITIONARY POLICY; MISGOVERNMENT BY NATIVE RULERS ; ANNEXATIONS OF THEIR TERRITORY, ETC.
1858 · PDF
Idries Shah 27 Books Collection : A Perfumed Scorpion, A Veiled Gazelle, Caravan of Dreams, Darkest England, Destination Mecca, Evenings with Idries Shah, Knowing How to Know, Learning How to Learn, Letters and Lectures of Idries Shah, Neglected aspects of Sufi study, Observations, Oriental Magic, Reflections, Seeker after Truth, Special Illumination, Special Problems in the study of Sufi ideas, Sufi thought and action, Tales of the Dervishes, The Dermis Probe, The Elephant in the Dark, The Englishman Handbook, Idries Shah Antology, The Magic Monastery, The natives are restless, wisdom of the Idiots PDF.
2022 · PDF
The travels of Capts. Lewis and Clarke from St. Louis, by way of the Missouri and Columbia rivers, to the Pacific ocean; performed in the years 1804, 1805 & 1806, by order of the government of the United States. Containing delineations of the manners, customs, religion, &c. of the Indians, comp. from various authentic sources, and original documents, and a summary of the Statistical view of the Indian nations, from the official communication of Meriwether Lewis. Illustrated with a map of the country, inhabited by the western tribes of Indians
1809 · PDF