Contents
herding cats
day 0
Intro to Cats
What is polymorphism?
Parametric polymorphism
Subtype polymorphism
Ad-hoc polymorphism
sum function
Monoid
FoldLeft
Typeclasses in Cats
Method injection (enrich my library)
Operator syntax for the standard datatypes
day 1
typeclasses 101
sbt
Eq
Order
PartialOrder
Show
Read
Enum
Numeric
typeclasses 102
A traffic light datatype
day 2
Making our own typeclass with simulacrum
Yes-No typeclass
Functor
Either as a functor
Function as a functor
Lifting a function
Checking laws with Discipline
Checking laws from the REPL
Checking laws with Discipline + MUnit
Breaking the law
Import guide
Implicits review
import cats._
Implicit scope
import cats.data._
import cats.implicits._
cats.instances.AllInstances
cats.syntax.AllSyntax
a la carte style
typeclass instances
Cats typeclass syntax
Cats datatype syntax
standard datatype syntax
all syntax
day 3
Kinds and some type-foo
forms-a vs is-a
Semigroupal
Cartesian law
Apply
The Applicative Style
List as a Apply
*> and <* operators
Option syntax
Option as an Apply
Useful functions for Apply
Apply law
Applicative
Useful functions for Applicative
Applicative Laws
day 4
Semigroup
The Semigroup typeclass
The Semigroup Laws
Lists are Semigroups
Product and Sum
Monoid
Monoid typeclass
Monoid laws
Value classes
Disjunction and Conjunction
Option as Monoids
About Laws
Using monoids to fold data structures
day 5
Apply.ap
Serializable typeclass instance
FlatMap
Getting our feet wet with Option
FlatMap laws
Monad
Walk the line
Banana on wire
for comprehension
Pierre returns
Pattern matching and failure
Monad laws
List datatype
FunctorFilter
A knight’s quest
day 6
do vs for
Implementing actM
Writer datatype
Writer
WriterT
Using for syntax with Writer
Adding logging to program
Inefficient List construction
Comparing performance
Reader datatype
Dependency injection
day 7
State datatype
State and StateT datatype
Getting and setting the state
Extracting and modifying the state
Validated datatype
Using NonEmptyList to accumulate failures
Ior datatype
day 8
Free monoids
Injective
Uniqueness
Free objects
Free monads
Why free monads matter
CharToy
Fix
FixE
Free datatype
Stackless Scala with Free Monads
Trampoline
Free monads
Free monoid using Free
Tail Recursive Monads (FlatMap)
The stack problem
FlatMap (MonadRec)
day 9
Some useful monadic functions
flatten method
filterM method
foldM function
Making a safe RPN calculator
Composing monadic functions
lift method
Making monads
Monads are fractals
List forms a monad under ++
Option forms a monad under?
State as a fractal
Look out for fractals
day 10
Monad transformers
Dependency injection again
Kleisli as ReaderT
Stacking Future and Either
EitherT datatype
day 11
Genericity
Genericity by value
Genericity by type
Genericity by function
Genericity by structure
Genericity by property
Genericity by stage
Genericity by shape
Datatype-generic programming with Bifunctor
Bifunctor
Deriving map from Bifunctor
Deriving fold from Bifunctor
Deriving unfold from Bifunctor
Tree
The Origami patterns
Const datatype
Monoidal applicative functors using Const datatype
Combining applicative functors
Product of functors
Product of apply functors
Product of applicative functors
Composition of Applicative
Product of applicative functions
Composition of applicative functions
day 12
Traverse
sequence function
TraverseFilter
filterA
Coercing type inference using partial unification
Shape and contents
Applicative wordcount
Modular iterations, applicatively
day 13
Id datatype
Id as Functor
Id as Apply
Id as FlatMap
What s the point of Id?
Eval datatype
Eval.later
Eval.now
Eval.always
stack-safe lazy computation
The Abstract Future
UserRepos with Future
UserRepos with Id
Coding in abstract
UserRepos with EitherT
day 14
SemigroupK
Option as SemigroupK
SemigroupK laws
MonoidK
MonoidK laws
Alternative
Alternative laws
Wolf, Goat, Cabbage
makeNMoves0
isSolution
makeMove
day 15
Basic category theory
Sets, arrows, composition
Point
Arrow
Category
Compose
Strong
Split
Isomorphism
Equality of arrows
Testing for isomorphism
day 16
Awodey s Category Theory
Milewski s Category Theory for Programmers
Sets
Sets
Pos
Finite categories
Cat
Monoid as categories
Mon
Grp
Forgetful functor
day 17
Initial and terminal objects
Uniquely determined up to isomorphism
Examples of initial objects
Examples of terminal objects
Product
Uniqueness of products
Duality
Opposite category
The duality principle
Coproduct
Algebraic datatype
Either datatype as coproduct
Curry-Howard encoding
Shapeless.Coproduct
EitherK datatype
day 18
Effect system
Cats Effect sbt setup
IO datatype
Hello world
Pizza app
ApplicativeError
Either as ApplicativeError
scala.util.Try as ApplicativeError
IO as ApplicativeError
MonadCancel
IO as MonadCancel
F.uncancelable
bracket
day 19
FunctionK
Higher-Rank Polymorphism in Scala
FunctionK in MonadCancel
Resource datatype
Resource as Monad
Resource cancellation
Ref as monad transformer
Resource as monad transformer
Contents in Depth
Combined Pages
herding cats
— Contents in Depth