SlideShare a Scribd company logo
Category Theory for Beginners
Your data structures
are made of maths!
Melbourne Scala User Group Mar 2015
@KenScambler
Data structures
More and more “logical”
Less low-level memory/hardware connection
More and more support for immutability
We can use maths to reason about them!
Category Theory can reveal even deeper symmetries
Algebraic Data Types
Constants, sums, products, exponents
We can directly manipulate them with algebra!
Products
A × B
NinjaTurtles
NinjaTurtles
×
BluesBrothers×
NinjaTurtles BluesBrothers
=
NTs and
BBs× =
×
=4 × 2 8
Integers as types?
We can actually use integers to represent our types!
The integers correspond to the size of the type
Products in code
(NinjaTurtle, BluesBrother)
(NinjaTurtle, BluesBrother)
4
(NinjaTurtle, BluesBrother)
4 2
NinjaTurtle (,) BluesBrother
4 2×
(NinjaTurtle, BluesBrother)
8
case class TurtleAndBrother(
foo1: NinjaTurtle,
foo2: BluesBrother)
case class TurtleAndBrother(
foo1: NinjaTurtle,
foo2: BluesBrother)
4
case class TurtleAndBrother(
foo1: NinjaTurtle,
foo2: BluesBrother)
4
2
case class TurtleAndBrother(…)
NinjaTurtle
BluesBrother
4
2
×
case class TurtleAndBrother(
foo1: NinjaTurtle,
foo2: BluesBrother)
8
trait Confluster {
def defrabulate(): BluesBrother
def empontigle(): NinjaTurtle
}
trait Confluster {
def defrabulate(): BluesBrother
def empontigle(): NinjaTurtle
}
2
trait Confluster {
def defrabulate(): BluesBrother
def empontigle(): NinjaTurtle
}
4
2
trait Confluster { def; def; }
BluesBrother
NinjaTurtle
2
4
×
trait Confluster {
def defrabulate(): BluesBrother
def empontigle(): NinjaTurtle
}
8
Sums
A + B
true
false
Boolean
true
false
+
Boolean Shapes+
true
false
+ =
Boolean Shapes
Boolean or
Shapes
true
false
+ =
true
false true
false
=2 + 4 6
sealed trait Holiday
case object Christmas extends Holiday
case object Easter extends Holiday
case object AnzacDay extends Holiday
Sums in code
sealed trait Holiday
case object Christmas extends Holiday
case object Easter extends Holiday
case object AnzacDay extends Holiday
1
sealed trait Holiday
case object Christmas extends Holiday
case object Easter extends Holiday
case object AnzacDay extends Holiday
11
sealed trait Holiday
case object Christmas extends Holiday
case object Easter extends Holiday
case object AnzacDay extends Holiday
11
1
sealed trait Holiday, case, extends
Christmas
Easter
AnzacDay
11
1
+
sealed trait Holiday
case object Christmas extends Holiday
case object Easter extends Holiday
case object AnzacDay extends Holiday
3
sealed trait Opt[A]
case class Some[A](a: A) extends Opt[A]
case class None[A] extends Opt[A]
sealed trait Opt[A]
case class Some[A](a: A) extends Opt[A]
case class None[A] extends Opt[A]
A
sealed trait Opt[A]
case class Some[A](a: A) extends Opt[A]
case class None[A] extends Opt[A]
A
1
sealed trait Opt[A], case class, extends
Some[A](a: A)
None[A]
A
1
+
sealed trait Opt[A]
case class Some[A](a: A) extends Opt[A]
case class None[A] extends Opt[A]A + 1
Either[Holiday, Opt[Boolean]]
Either[Holiday, Opt[Boolean]]
3
Either[Holiday, Opt[Boolean]]
3 2
Either[Holiday, Opt[Boolean]]
3 2 + 1
Either[Holiday, Opt[Boolean]]
3 3
Either[Holiday, Opt[Boolean]]
3 3+
Either[Holiday, Opt[Boolean]]
6
Exponents
BA
Exponents
BA
A type to the power of another type?? Huh?
true
false
Boolean
true
false
Boolean
Shapes
true
false
Boolean
Shapes = Shapes  Boolean
true
false
true
false
true
false
true
false
true
false
true
false
true
false
true
false
true
false
23 =
true
false
true
false
true
false
true
false
true
false
true
false
true
false
true
false
8
Function types =
exponents!
A  B = BA
Exponents in code
def getTurtle(): NinjaTurtles
def getTurtle: () => NinjaTurtles
def getTurtle: () => NinjaTurtles
1
def getTurtle: () => NinjaTurtles
1 4
def getTurtle: () => NinjaTurtles
1  4
def getTurtle: () => NinjaTurtles
41
def getTurtle: () => NinjaTurtles
4
Functions “with no arguments”
are tacitly from a singleton type
such as Unit
Singleton types carry no
information.
trait State[S, A] {
def run(state: S): (A, S)
}
trait State[S, A] {
def run(state: S): (A, S)
}
A×S
trait State[S, A] {
def run(state: S): (A, S)
}
S  A×S
trait State[S, A] {
def run(state: S): (A, S)
}
(A×S)S
{•}
Zero
On
e
Product
s
Sum
sExponent
s
Sets Scala Algebra
{}
A×B
A∪B
AB
(A, B)
0
1
AB
A+B
A -> B
A / B
Nothing
Unit
BA
Currying
def tupled[A, B, C](a: A, b: B): C
def curried[A, B, C]: A => (B => C)
Currying
def tupled[A, B, C](a: A, b: B): C
def curried[A, B, C]: A => (B => C)
A×B
Currying
def tupled[A, B, C](a: A, b: B): C
def curried[A, B, C]: A => (B => C)
A×B  C
Currying
def tupled[A, B, C](a: A, b: B): C
def curried[A, B, C]: A => (B => C)
CAB
Currying
def tupled[A, B, C](a: A, b: B): C
def curried[A, B, C]: A => (B => C)
CAB
A(B  C)
Currying
def tupled[A, B, C](a: A, b: B): C
def curried[A, B, C]: A => (B => C)
CAB
ACB
Currying
def tupled[A, B, C](a: A, b: B): C
def curried[A, B, C]: A => (B => C)
CAB
CAB
Recursion
sealed trait List[+A]
case class Cons[A](h: A, t: List[A])
extends List[A]
case object Nil extends List[Nothing]
sealed trait List[+A]
case class Cons[A](h: A, t: List[A])
extends List[A]
case object Nil extends List[Nothing]
A
sealed trait List[+A]
case class Cons[A](h: A, t: List[A])
extends List[A]
case object Nil extends List[Nothing]
A L(A)
sealed trait List[+A]
case class Cons[A](h: A, t: List[A])
extends List[A]
case object Nil extends List[Nothing]
A × L(A)
sealed trait List[+A]
case class Cons[A](h: A, t: List[A])
extends List[A]
case object Nil extends List[Nothing]
A × L(A)
1
sealed trait List[+A]
case class Cons[A](h: A, t: List[A])
extends List[A]
case object Nil extends List[Nothing]
1 + A × L(A)
Expanding a list…
L(a) = 1 + a × L(a)
Expanding a list…
L(a) = 1 + a L(a)
Expanding a list…
L(a) = 1 + a L(a)
= 1 + a (1 + a L(a))
Expanding a list…
L(a) = 1 + a L(a)
= 1 + a (1 + a L(a))
= 1 + a + a2 (1 + a L(a))
Expanding a list…
L(a) = 1 + a L(a)
= 1 + a (1 + a L(a))
= 1 + a + a2 (1 + a L(a))
…
= 1 + a + a2 + a3 + a4 + a5…
Expanding a list…
L(a) = 1 + a L(a)
= 1 + a (1 + a L(a))
= 1 + a + a2 (1 + a L(a))
…
= 1 + a + a2 + a3 + a4 + a5…
Nil
or 1-length
or 2-length
or 3-length
or 4-length
etc
What does it mean for
two types to have the
same number?
Not identical… but
isomorphic
Terminology
isomorphism
Terminology
isomorphism
Equal
Terminology
isomorphism
Equal-shape-ism
Terminology
isomorphism
“Sorta kinda the same-ish”
but I want to sound really
smart
- Programmers
Terminology
isomorphism
“Sorta kinda the same-ish”
but I want to sound really
smart
- Programmers
Terminology
isomorphism
One-to-one mapping
between two objects so
you can go back-and-forth
without losing information
These 4
Shapes
Wiggles
Set
functions
Set
4 = 4
These 4
Shapes
Wiggles
These 4
Shapes
Wiggles
There can be lots of
isos between two
objects!
If there’s at least one, we
can say they are
isomorphic
or A ≅ B
Programming
language
syntaxProgramming
language
FEATURES!!!
NAMES
NAMES
NAMES
actual
structure
Programming
language
syntax
Programming
language
FEATURES!!!
NAMES
NAMES
NAMES
actual
structure
class Furpular { class Diggleton {
} }
Programming
language
syntaxProgramming
language
FEATURES!!!
NAMES
NAMES
NAMES
actual
structure
Programming
language
syntax
Programming
language
FEATURES!!!
NAMES
NAMES
NAMES
actual
structure
class Furpular { class Diggleton {
} }
Programming
language
syntaxProgramming
language
FEATURES!!!
NAMES
NAMES
NAMES
actual
structure
Programming
language
syntax
Programming
language
FEATURES!!!
NAMES
NAMES
NAMES
actual
structure
class Furpular { class Diggleton {
} }
Looking at data structures
algebraically lets us
compare the true structure
actual
structure
but faster
actual
structure
Knowing an isomorphism, we
can rewrite for
• Performance
• Memory usage
• Elegance
with proven correctness!
actual
structure
but faster
actual
structure
Knowing an isomorphism, we
can rewrite for
• Performance
• Memory usage
• Elegance
with proven correctness!*
*mumble mumble non-termination
Category Theory
object
A B
object
arrow
Arrows join objects. They can
represent absolutely
anything.
Categories generalise
functions over sets
A B
f
Arrows compose like
functions
A B C
f g
Arrows compose like
functions
A C
g ∘ f
A
Every object has an identity arrow,
just like the identity function
That’s all a category
is!
Products in CT
A × BA B
first seco
nd
trait Product[A,B] {
def first: A
def second: B
}
Sums in CT
A + BA B
Left Right
sealed trait Sum[A,B]
case class Left[A,B](a: A)
extends Sum[A,B]
case class Right[A,B](b: B)
extends Sum[A,B]
Opposite categories
C Cop
A
B
C
g ∘ f
f
g
A
B
C
f ∘ g
f
g
Isomorphic!
A
B
C
g ∘ f
f
g
A
B
C
f ∘ g
f
g
Just flip the arrows, and
reverse composition!
A
A×B
B
A product in C is a sum in Cop
A sum in C is a product in Cop
A+B
B
A
C Cop
Sums are
isomorphic to
Products!
Terminology
dual
An object and its equivalent in the
opposite category are
to each other.
Terminology
Co-(thing)
Often we call something’s dual a
Terminology
Coproducts
Sums are also called
Tightening the definitions
A × BA B
first seco
nd
×
×
trait ProductPlusPlus[A,B] {
def first: A
def second: B
def banana: Banana
def brother: BluesBrother
}
A × BA B
first seco
nd
×
×
Does that still count as A × B?
A × BA B
first seco
nd
×
×
No
way!
A × BA B
first seco
nd
×
×
Umpire
theA someB
trait Umpire {
def theA: A
def someB: B
}
A × BA B
first seco
nd
×
×
Umpire
theA someB
trait Umpire {
def theA: A
def someB: B
}
unique∃
(a, b,a b
Umpire
trait Umpire {
def theA: A = a
def someB: B = b
}
, )Instances
(a, b,a b
Umpire
trait Umpire {
def theA: A = a
def someB: B = b
}
, )Instances
(a, b,a b
Umpire
trait Umpire {
def theA: A = a
def someB: B = b
}
, )
not
actually
unique 
Instances
Requiring a unique arrow
from a 3rd object that
independently knows A
and B proves that there’s
no extra gunk.
But wait!
What if Umpire has
special knowledge about
other products?
A × BA B
first seco
nd
Umpire
theA someB
trait Umpire {
def theA: A
def someB: B
def specialOtherProd: (A,B)
}
It could introduce strange
new things with its special
knowledge!
We need to know nothing
about the object other
than the two arrows!
PA B
???
? ?
unique∃
For all objects that
1) have an arrow to A and B
2) there exists a unique arrow to P
PA B
???
? ?
unique∃
Then P is “the” product of A and B!
Same with
sums!
SA B
???
? ?
unique∃
For all objects that
1) have an arrow from A and B
2) there exists a unique arrow from S
SA B
???
? ?
unique∃
Then S is “the” sum of A and B!
Terminology
universal property
universal mapping
property
UMP
Terminology
universal property
“The most efficient solution to a
problem”
Terminology
universal property
Proves that
- We generate only what we need
- We depend on only what we need
Compare to programming:
trait Monoid[M] {
def id: M
def compose(a: M, b: M): M
}
trait Foldable[F[_]] {
def foldMap[M: Monoid, A](
fa: F[A], f: A => M): M
}
Like UMPs, type parameters
“for all F”
“for all A and M where M is a Monoid”
don’t just prove what your code is,
but what it isn’t.
Proving what your code isn’t
prevents bloat and error, and
promotes reuse.
Proving what your code is allows
you to use it.
Zero
On
eProduct
s
Sum
s
Exponent
s
Scala Algebra
(A, B)
0
1
AB
A+B
A -> B
A / B
Nothing
Unit
BA
Types vs Algebra vs CT
CT
?
?
?
?
? ?
Intermission
Injections
A B
A function is injective if it maps 1-to-1
onto a subset of the codomain
A B
All the information in A is
preserved…
A B
All the information in A is
preserved…
A
B
But everything else in B is lost.
A B
Another way of looking at it…
C A Bfg
h
If f ∘ g = f ∘ h, then g = h
C A Bfg
h
If f ∘ g = f ∘ h, then g = h
C A Bfg
h
If f ∘ g = f ∘ h, then g = h
Injections in code
User(
firstName = "Bob",
lastName = "Smith",
age = 73)
User JSON
{
“firstName”: "Bob",
“lastName”: ”Smith”,
“age”: 73
}
User JSON
We don’t lose information converting
to JSON.
But from JSON?
We lose structure…
User JSON
Surjections
A B
A function is surjective if it maps
onto the whole of the codomain
A
All the information in B is
preserved…
AB
A
But everything else in A is lost.
AB
A B C
If g ∘ f = h ∘ f, then g = h
f g
h
A B C
f g
h
If g ∘ f = h ∘ f, then g = h
A B C
f g
h
If g ∘ f = h ∘ f, then g = h
Injections generalised
C A Bf
g
h
If f ∘ g = f ∘ h, then g = h
Monomorphisms
C A Bf
g
h
f is monic
If f ∘ g = f ∘ h, then g = h
Monomorphisms
C A Bf
g
h
If f ∘ g = f ∘ h, then g = h
Surjections generalised
CA Bf
g
h
If g ∘ f = h ∘ f, then g = h
Epimorphisms
CA Bf
g
h
f is epic
If g ∘ f = h ∘ f, then g = h
C
A
B
A mono in C is an epi in Cop
A
B
C Cop
C
Monos are dual to
epis.
Bijections
A B
A function is bijective if it maps 1-to-1
onto the whole codomain
Bijections
A B
We don’t lose any
information A  B  A…
A
Bijections
B
Nor do we lose information
B  A  B…
A B
The CT equivalent is of
course…
The CT equivalent is of
course…
Isomorphisms!
Injection Surjection Bijection
Mono Epi Iso
Motivation
So much software is just mapping
between things!
form
form
{…}
form
{…} Order(a,b,c)
form
{…} Order(a,b,c) INSERT INTO…
form
{…} Order(a,b,c) INSERT INTO…
form
{…} Order(a,b,c) INSERT INTO…
Receipt(…)
form
{…} Order(a,b,c) INSERT INTO…
Receipt(…)
Logs on disk
form
{…} Order(a,b,c) INSERT INTO…
Receipt(…)
Logs on disk
<xml>
form
{…} Order(a,b,c) INSERT INTO…
Receipt(…)<xml>
receipt
Logs on disk
It is essential to understand how
information is preserved in flows like
this
Chinese
whispers!
Bugs proliferate where data is lost!
Injections and surjections tell us
what is preserved and what is lost
Bijections are especially valuable
Conclusion
Data structures are
made out of maths!
How we map between them
is maths too.
Understanding the
underlying shape of data
and functions is enormously
helpful for more robust,
error-free software
Isomorphism is more
interesting than
equality!
Isomorphic types can be
rewritten, optimised without
error.
Isomorphic mappings allow
us to preserve information
Universal properties exemplify
• Depending on the minimum
• Producing the minimum
?
Again, Category Theory
shows us deeper, simpler
patterns, unifying concepts
that otherwise look different
?
?
×
+
Further reading
Awodey, “Category Theory”
Lawvere & Schanuel, “Conceptual Mathematics: an
introduction to categories”
Jeremy Kun, “Math ∩ Programming” at
http://jeremykun.com/
Chris Taylor, “The algebra of algebraic datatypes”
http://chris-taylor.github.io/blog/2013/02/10/the-algebra-of-
algebraic-data-types/
http://chris-taylor.github.io/blog/2013/02/11/the-algebra-of-
algebraic-data-types-part-ii/
http://chris-taylor.github.io/blog/2013/02/13/the-algebra-of-
algebraic-data-types-part-iii/
Further reading
Bartosz Milewski “Categories for Programmers”
http://bartoszmilewski.com/2014/10/28/category-theory-for-
programmers-the-preface/
http://bartoszmilewski.com/2015/03/13/function-types/

More Related Content

What's hot

Fp in scala with adts part 2
Fp in scala with adts part 2Fp in scala with adts part 2
Fp in scala with adts part 2
Hang Zhao
 
Contravariant functors in scala
Contravariant functors in scalaContravariant functors in scala
Contravariant functors in scala
Piotr Paradziński
 
Kleisli composition, flatMap, join, map, unit - implementation and interrelation
Kleisli composition, flatMap, join, map, unit - implementation and interrelationKleisli composition, flatMap, join, map, unit - implementation and interrelation
Kleisli composition, flatMap, join, map, unit - implementation and interrelation
Philip Schwarz
 
Monad Transformers - Part 1
Monad Transformers - Part 1Monad Transformers - Part 1
Monad Transformers - Part 1
Philip Schwarz
 
Sequence and Traverse - Part 1
Sequence and Traverse - Part 1Sequence and Traverse - Part 1
Sequence and Traverse - Part 1
Philip Schwarz
 
Sequence and Traverse - Part 3
Sequence and Traverse - Part 3Sequence and Traverse - Part 3
Sequence and Traverse - Part 3
Philip Schwarz
 
Abstracting over the Monad yielded by a for comprehension and its generators
Abstracting over the Monad yielded by a for comprehension and its generatorsAbstracting over the Monad yielded by a for comprehension and its generators
Abstracting over the Monad yielded by a for comprehension and its generators
Philip Schwarz
 
Why The Free Monad isn't Free
Why The Free Monad isn't FreeWhy The Free Monad isn't Free
Why The Free Monad isn't Free
Kelley Robinson
 
Scala. Introduction to FP. Monads
Scala. Introduction to FP. MonadsScala. Introduction to FP. Monads
Scala. Introduction to FP. Monads
Kirill Kozlov
 
Monad Fact #2
Monad Fact #2Monad Fact #2
Monad Fact #2
Philip Schwarz
 
Functionsandpigeonholeprinciple
FunctionsandpigeonholeprincipleFunctionsandpigeonholeprinciple
Functionsandpigeonholeprinciple
Shiwani Gupta
 
Monad Fact #4
Monad Fact #4Monad Fact #4
Monad Fact #4
Philip Schwarz
 
Functors
FunctorsFunctors
Functors
Philip Schwarz
 
Type Parameterization
Type ParameterizationType Parameterization
Type Parameterization
Knoldus Inc.
 
Array
ArrayArray
Effective way to code in Scala
Effective way to code in ScalaEffective way to code in Scala
Effective way to code in Scala
Knoldus Inc.
 
mathematical functions
mathematical functions mathematical functions
mathematical functions
Anshul gour
 
Addendum to ‘Monads do not Compose’
Addendum to ‘Monads do not Compose’ Addendum to ‘Monads do not Compose’
Addendum to ‘Monads do not Compose’
Philip Schwarz
 
Introduction to Monads in Scala (2)
Introduction to Monads in Scala (2)Introduction to Monads in Scala (2)
Introduction to Monads in Scala (2)stasimus
 
2.5 computations of derivatives
2.5 computations of derivatives2.5 computations of derivatives
2.5 computations of derivativesmath265
 

What's hot (20)

Fp in scala with adts part 2
Fp in scala with adts part 2Fp in scala with adts part 2
Fp in scala with adts part 2
 
Contravariant functors in scala
Contravariant functors in scalaContravariant functors in scala
Contravariant functors in scala
 
Kleisli composition, flatMap, join, map, unit - implementation and interrelation
Kleisli composition, flatMap, join, map, unit - implementation and interrelationKleisli composition, flatMap, join, map, unit - implementation and interrelation
Kleisli composition, flatMap, join, map, unit - implementation and interrelation
 
Monad Transformers - Part 1
Monad Transformers - Part 1Monad Transformers - Part 1
Monad Transformers - Part 1
 
Sequence and Traverse - Part 1
Sequence and Traverse - Part 1Sequence and Traverse - Part 1
Sequence and Traverse - Part 1
 
Sequence and Traverse - Part 3
Sequence and Traverse - Part 3Sequence and Traverse - Part 3
Sequence and Traverse - Part 3
 
Abstracting over the Monad yielded by a for comprehension and its generators
Abstracting over the Monad yielded by a for comprehension and its generatorsAbstracting over the Monad yielded by a for comprehension and its generators
Abstracting over the Monad yielded by a for comprehension and its generators
 
Why The Free Monad isn't Free
Why The Free Monad isn't FreeWhy The Free Monad isn't Free
Why The Free Monad isn't Free
 
Scala. Introduction to FP. Monads
Scala. Introduction to FP. MonadsScala. Introduction to FP. Monads
Scala. Introduction to FP. Monads
 
Monad Fact #2
Monad Fact #2Monad Fact #2
Monad Fact #2
 
Functionsandpigeonholeprinciple
FunctionsandpigeonholeprincipleFunctionsandpigeonholeprinciple
Functionsandpigeonholeprinciple
 
Monad Fact #4
Monad Fact #4Monad Fact #4
Monad Fact #4
 
Functors
FunctorsFunctors
Functors
 
Type Parameterization
Type ParameterizationType Parameterization
Type Parameterization
 
Array
ArrayArray
Array
 
Effective way to code in Scala
Effective way to code in ScalaEffective way to code in Scala
Effective way to code in Scala
 
mathematical functions
mathematical functions mathematical functions
mathematical functions
 
Addendum to ‘Monads do not Compose’
Addendum to ‘Monads do not Compose’ Addendum to ‘Monads do not Compose’
Addendum to ‘Monads do not Compose’
 
Introduction to Monads in Scala (2)
Introduction to Monads in Scala (2)Introduction to Monads in Scala (2)
Introduction to Monads in Scala (2)
 
2.5 computations of derivatives
2.5 computations of derivatives2.5 computations of derivatives
2.5 computations of derivatives
 

Viewers also liked

Running Free with the Monads
Running Free with the MonadsRunning Free with the Monads
Running Free with the Monads
kenbot
 
Data structure and its types
Data structure and its typesData structure and its types
Data structure and its typesNavtar Sidhu Brar
 
Data made out of functions
Data made out of functionsData made out of functions
Data made out of functions
kenbot
 
The Yoneda lemma and String diagrams
The Yoneda lemma and String diagramsThe Yoneda lemma and String diagrams
The Yoneda lemma and String diagrams
Ray Sameshima
 
2 Years of Real World FP at REA
2 Years of Real World FP at REA2 Years of Real World FP at REA
2 Years of Real World FP at REA
kenbot
 
Thinking Functionally
Thinking FunctionallyThinking Functionally
Thinking Functionally
Piyush Katariya
 
Programming Methodology
Programming MethodologyProgramming Methodology
Programming Methodology
archikabhatia
 
Link Walking with Riak
Link Walking with RiakLink Walking with Riak
Link Walking with Riak
Susan Potter
 
Distributed Developer Workflows using Git
Distributed Developer Workflows using GitDistributed Developer Workflows using Git
Distributed Developer Workflows using Git
Susan Potter
 
Dynamo: Not Just For Datastores
Dynamo: Not Just For DatastoresDynamo: Not Just For Datastores
Dynamo: Not Just For Datastores
Susan Potter
 
Writing Bullet-Proof Javascript: By Using CoffeeScript
Writing Bullet-Proof Javascript: By Using CoffeeScriptWriting Bullet-Proof Javascript: By Using CoffeeScript
Writing Bullet-Proof Javascript: By Using CoffeeScript
Susan Potter
 
From Zero To Production (NixOS, Erlang) @ Erlang Factory SF 2016
From Zero To Production (NixOS, Erlang) @ Erlang Factory SF 2016From Zero To Production (NixOS, Erlang) @ Erlang Factory SF 2016
From Zero To Production (NixOS, Erlang) @ Erlang Factory SF 2016
Susan Potter
 
Ricon/West 2013: Adventures with Riak Pipe
Ricon/West 2013: Adventures with Riak PipeRicon/West 2013: Adventures with Riak Pipe
Ricon/West 2013: Adventures with Riak Pipe
Susan Potter
 
From Zero to Application Delivery with NixOS
From Zero to Application Delivery with NixOSFrom Zero to Application Delivery with NixOS
From Zero to Application Delivery with NixOS
Susan Potter
 
Designing for Concurrency
Designing for ConcurrencyDesigning for Concurrency
Designing for Concurrency
Susan Potter
 
Functional Algebra: Monoids Applied
Functional Algebra: Monoids AppliedFunctional Algebra: Monoids Applied
Functional Algebra: Monoids Applied
Susan Potter
 
BIg Data Trends in 2016
BIg Data Trends in 2016BIg Data Trends in 2016
BIg Data Trends in 2016
Stig-Arne Kristoffersen
 
1DMP: Marketing Data Platform - the future of data-driven marketing
1DMP: Marketing Data Platform - the future of data-driven marketing1DMP: Marketing Data Platform - the future of data-driven marketing
1DMP: Marketing Data Platform - the future of data-driven marketing
CleverLEAF
 
Internet of Things and Big Data
Internet of Things and Big DataInternet of Things and Big Data
Internet of Things and Big Data
Swiss Data Forum Swiss Data Forum
 
Scala Data Pipelines @ Spotify
Scala Data Pipelines @ SpotifyScala Data Pipelines @ Spotify
Scala Data Pipelines @ Spotify
Neville Li
 

Viewers also liked (20)

Running Free with the Monads
Running Free with the MonadsRunning Free with the Monads
Running Free with the Monads
 
Data structure and its types
Data structure and its typesData structure and its types
Data structure and its types
 
Data made out of functions
Data made out of functionsData made out of functions
Data made out of functions
 
The Yoneda lemma and String diagrams
The Yoneda lemma and String diagramsThe Yoneda lemma and String diagrams
The Yoneda lemma and String diagrams
 
2 Years of Real World FP at REA
2 Years of Real World FP at REA2 Years of Real World FP at REA
2 Years of Real World FP at REA
 
Thinking Functionally
Thinking FunctionallyThinking Functionally
Thinking Functionally
 
Programming Methodology
Programming MethodologyProgramming Methodology
Programming Methodology
 
Link Walking with Riak
Link Walking with RiakLink Walking with Riak
Link Walking with Riak
 
Distributed Developer Workflows using Git
Distributed Developer Workflows using GitDistributed Developer Workflows using Git
Distributed Developer Workflows using Git
 
Dynamo: Not Just For Datastores
Dynamo: Not Just For DatastoresDynamo: Not Just For Datastores
Dynamo: Not Just For Datastores
 
Writing Bullet-Proof Javascript: By Using CoffeeScript
Writing Bullet-Proof Javascript: By Using CoffeeScriptWriting Bullet-Proof Javascript: By Using CoffeeScript
Writing Bullet-Proof Javascript: By Using CoffeeScript
 
From Zero To Production (NixOS, Erlang) @ Erlang Factory SF 2016
From Zero To Production (NixOS, Erlang) @ Erlang Factory SF 2016From Zero To Production (NixOS, Erlang) @ Erlang Factory SF 2016
From Zero To Production (NixOS, Erlang) @ Erlang Factory SF 2016
 
Ricon/West 2013: Adventures with Riak Pipe
Ricon/West 2013: Adventures with Riak PipeRicon/West 2013: Adventures with Riak Pipe
Ricon/West 2013: Adventures with Riak Pipe
 
From Zero to Application Delivery with NixOS
From Zero to Application Delivery with NixOSFrom Zero to Application Delivery with NixOS
From Zero to Application Delivery with NixOS
 
Designing for Concurrency
Designing for ConcurrencyDesigning for Concurrency
Designing for Concurrency
 
Functional Algebra: Monoids Applied
Functional Algebra: Monoids AppliedFunctional Algebra: Monoids Applied
Functional Algebra: Monoids Applied
 
BIg Data Trends in 2016
BIg Data Trends in 2016BIg Data Trends in 2016
BIg Data Trends in 2016
 
1DMP: Marketing Data Platform - the future of data-driven marketing
1DMP: Marketing Data Platform - the future of data-driven marketing1DMP: Marketing Data Platform - the future of data-driven marketing
1DMP: Marketing Data Platform - the future of data-driven marketing
 
Internet of Things and Big Data
Internet of Things and Big DataInternet of Things and Big Data
Internet of Things and Big Data
 
Scala Data Pipelines @ Spotify
Scala Data Pipelines @ SpotifyScala Data Pipelines @ Spotify
Scala Data Pipelines @ Spotify
 

Similar to Your data structures are made of maths!

Monoids, monoids, monoids
Monoids, monoids, monoidsMonoids, monoids, monoids
Monoids, monoids, monoids
Luka Jacobowitz
 
Zippers
ZippersZippers
Zippers
David Overton
 
Monoids, Monoids, Monoids - ScalaLove 2020
Monoids, Monoids, Monoids - ScalaLove 2020Monoids, Monoids, Monoids - ScalaLove 2020
Monoids, Monoids, Monoids - ScalaLove 2020
Luka Jacobowitz
 
Algebraic Data Types and Origami Patterns
Algebraic Data Types and Origami PatternsAlgebraic Data Types and Origami Patterns
Algebraic Data Types and Origami PatternsVasil Remeniuk
 
SET THEORY
SET THEORYSET THEORY
SET THEORYLena
 
Pdm presentation
Pdm presentationPdm presentation
Pdm presentation
Budiana Putu
 
Sets in Maths (Complete Topic)
Sets in Maths (Complete Topic)Sets in Maths (Complete Topic)
Sets in Maths (Complete Topic)
Manik Bhola
 
Functors, in theory and in practice
Functors, in theory and in practiceFunctors, in theory and in practice
Functors, in theory and in practice
Martin Menestret
 
Oh, All the things you'll traverse
Oh, All the things you'll traverseOh, All the things you'll traverse
Oh, All the things you'll traverse
Luka Jacobowitz
 
Power of functions in a typed world
Power of functions in a typed worldPower of functions in a typed world
Power of functions in a typed world
Debasish Ghosh
 
Answers Of Discrete Mathematics
Answers Of Discrete MathematicsAnswers Of Discrete Mathematics
Answers Of Discrete Mathematics
Sabrina Green
 
6.5 determinant x
6.5 determinant x6.5 determinant x
6.5 determinant x
math260
 
Properties of Addition & Multiplication
Properties of Addition & MultiplicationProperties of Addition & Multiplication
Properties of Addition & Multiplicationitutor
 
Developer Intro Deck-PowerPoint - Download for Speaker Notes
Developer Intro Deck-PowerPoint - Download for Speaker NotesDeveloper Intro Deck-PowerPoint - Download for Speaker Notes
Developer Intro Deck-PowerPoint - Download for Speaker Notes
Max De Marzi
 
7th maths-1.concept , addition and subtraction properties of intergers-sangh
7th maths-1.concept , addition and subtraction properties of intergers-sangh7th maths-1.concept , addition and subtraction properties of intergers-sangh
7th maths-1.concept , addition and subtraction properties of intergers-sangh
LiveOnlineClassesInd
 
7th maths-1.concept , addition and subtraction properties of intergers
7th maths-1.concept , addition and subtraction properties of intergers7th maths-1.concept , addition and subtraction properties of intergers
7th maths-1.concept , addition and subtraction properties of intergers
LiveOnlineClassesInd
 
Lesson2_MathematicalLanguageAndSymbols _Lesson 2.1_VariablesAndTheLanguageOfS...
Lesson2_MathematicalLanguageAndSymbols _Lesson 2.1_VariablesAndTheLanguageOfS...Lesson2_MathematicalLanguageAndSymbols _Lesson 2.1_VariablesAndTheLanguageOfS...
Lesson2_MathematicalLanguageAndSymbols _Lesson 2.1_VariablesAndTheLanguageOfS...
LouelaDePaz
 
Discrete mathematic
Discrete mathematicDiscrete mathematic
Discrete mathematic
Naralaswapna
 

Similar to Your data structures are made of maths! (20)

Monoids, monoids, monoids
Monoids, monoids, monoidsMonoids, monoids, monoids
Monoids, monoids, monoids
 
Zippers
ZippersZippers
Zippers
 
Monoids, Monoids, Monoids - ScalaLove 2020
Monoids, Monoids, Monoids - ScalaLove 2020Monoids, Monoids, Monoids - ScalaLove 2020
Monoids, Monoids, Monoids - ScalaLove 2020
 
Algebraic Data Types and Origami Patterns
Algebraic Data Types and Origami PatternsAlgebraic Data Types and Origami Patterns
Algebraic Data Types and Origami Patterns
 
Sets
SetsSets
Sets
 
SET THEORY
SET THEORYSET THEORY
SET THEORY
 
Pdm presentation
Pdm presentationPdm presentation
Pdm presentation
 
Sets in Maths (Complete Topic)
Sets in Maths (Complete Topic)Sets in Maths (Complete Topic)
Sets in Maths (Complete Topic)
 
Functors, in theory and in practice
Functors, in theory and in practiceFunctors, in theory and in practice
Functors, in theory and in practice
 
Oh, All the things you'll traverse
Oh, All the things you'll traverseOh, All the things you'll traverse
Oh, All the things you'll traverse
 
Power of functions in a typed world
Power of functions in a typed worldPower of functions in a typed world
Power of functions in a typed world
 
Answers Of Discrete Mathematics
Answers Of Discrete MathematicsAnswers Of Discrete Mathematics
Answers Of Discrete Mathematics
 
6.5 determinant x
6.5 determinant x6.5 determinant x
6.5 determinant x
 
Properties of Addition & Multiplication
Properties of Addition & MultiplicationProperties of Addition & Multiplication
Properties of Addition & Multiplication
 
Developer Intro Deck-PowerPoint - Download for Speaker Notes
Developer Intro Deck-PowerPoint - Download for Speaker NotesDeveloper Intro Deck-PowerPoint - Download for Speaker Notes
Developer Intro Deck-PowerPoint - Download for Speaker Notes
 
7th maths-1.concept , addition and subtraction properties of intergers-sangh
7th maths-1.concept , addition and subtraction properties of intergers-sangh7th maths-1.concept , addition and subtraction properties of intergers-sangh
7th maths-1.concept , addition and subtraction properties of intergers-sangh
 
7th maths-1.concept , addition and subtraction properties of intergers
7th maths-1.concept , addition and subtraction properties of intergers7th maths-1.concept , addition and subtraction properties of intergers
7th maths-1.concept , addition and subtraction properties of intergers
 
Lesson2_MathematicalLanguageAndSymbols _Lesson 2.1_VariablesAndTheLanguageOfS...
Lesson2_MathematicalLanguageAndSymbols _Lesson 2.1_VariablesAndTheLanguageOfS...Lesson2_MathematicalLanguageAndSymbols _Lesson 2.1_VariablesAndTheLanguageOfS...
Lesson2_MathematicalLanguageAndSymbols _Lesson 2.1_VariablesAndTheLanguageOfS...
 
Discrete mathematic
Discrete mathematicDiscrete mathematic
Discrete mathematic
 
Integers
IntegersIntegers
Integers
 

More from kenbot

Grow your own tech leads
Grow your own tech leadsGrow your own tech leads
Grow your own tech leads
kenbot
 
Applied category theory: the emerging science of compositionality
Applied category theory: the emerging science of compositionalityApplied category theory: the emerging science of compositionality
Applied category theory: the emerging science of compositionality
kenbot
 
Responsible DI: Ditch the Frameworks
Responsible DI: Ditch the FrameworksResponsible DI: Ditch the Frameworks
Responsible DI: Ditch the Frameworks
kenbot
 
FP adoption at REA
FP adoption at REAFP adoption at REA
FP adoption at REA
kenbot
 
Lenses for the masses - introducing Goggles
Lenses for the masses - introducing GogglesLenses for the masses - introducing Goggles
Lenses for the masses - introducing Goggles
kenbot
 
Good functional programming is good programming
Good functional programming is good programmingGood functional programming is good programming
Good functional programming is good programming
kenbot
 
Imagine a world without mocks
Imagine a world without mocksImagine a world without mocks
Imagine a world without mocks
kenbot
 
The disaster of mutable state
The disaster of mutable stateThe disaster of mutable state
The disaster of mutable state
kenbot
 

More from kenbot (8)

Grow your own tech leads
Grow your own tech leadsGrow your own tech leads
Grow your own tech leads
 
Applied category theory: the emerging science of compositionality
Applied category theory: the emerging science of compositionalityApplied category theory: the emerging science of compositionality
Applied category theory: the emerging science of compositionality
 
Responsible DI: Ditch the Frameworks
Responsible DI: Ditch the FrameworksResponsible DI: Ditch the Frameworks
Responsible DI: Ditch the Frameworks
 
FP adoption at REA
FP adoption at REAFP adoption at REA
FP adoption at REA
 
Lenses for the masses - introducing Goggles
Lenses for the masses - introducing GogglesLenses for the masses - introducing Goggles
Lenses for the masses - introducing Goggles
 
Good functional programming is good programming
Good functional programming is good programmingGood functional programming is good programming
Good functional programming is good programming
 
Imagine a world without mocks
Imagine a world without mocksImagine a world without mocks
Imagine a world without mocks
 
The disaster of mutable state
The disaster of mutable stateThe disaster of mutable state
The disaster of mutable state
 

Recently uploaded

Final project report on grocery store management system..pdf
Final project report on grocery store management system..pdfFinal project report on grocery store management system..pdf
Final project report on grocery store management system..pdf
Kamal Acharya
 
ethical hacking-mobile hacking methods.ppt
ethical hacking-mobile hacking methods.pptethical hacking-mobile hacking methods.ppt
ethical hacking-mobile hacking methods.ppt
Jayaprasanna4
 
Standard Reomte Control Interface - Neometrix
Standard Reomte Control Interface - NeometrixStandard Reomte Control Interface - Neometrix
Standard Reomte Control Interface - Neometrix
Neometrix_Engineering_Pvt_Ltd
 
Pile Foundation by Venkatesh Taduvai (Sub Geotechnical Engineering II)-conver...
Pile Foundation by Venkatesh Taduvai (Sub Geotechnical Engineering II)-conver...Pile Foundation by Venkatesh Taduvai (Sub Geotechnical Engineering II)-conver...
Pile Foundation by Venkatesh Taduvai (Sub Geotechnical Engineering II)-conver...
AJAYKUMARPUND1
 
ethical hacking in wireless-hacking1.ppt
ethical hacking in wireless-hacking1.pptethical hacking in wireless-hacking1.ppt
ethical hacking in wireless-hacking1.ppt
Jayaprasanna4
 
Top 10 Oil and Gas Projects in Saudi Arabia 2024.pdf
Top 10 Oil and Gas Projects in Saudi Arabia 2024.pdfTop 10 Oil and Gas Projects in Saudi Arabia 2024.pdf
Top 10 Oil and Gas Projects in Saudi Arabia 2024.pdf
Teleport Manpower Consultant
 
English lab ppt no titlespecENG PPTt.pdf
English lab ppt no titlespecENG PPTt.pdfEnglish lab ppt no titlespecENG PPTt.pdf
English lab ppt no titlespecENG PPTt.pdf
BrazilAccount1
 
Design and Analysis of Algorithms-DP,Backtracking,Graphs,B&B
Design and Analysis of Algorithms-DP,Backtracking,Graphs,B&BDesign and Analysis of Algorithms-DP,Backtracking,Graphs,B&B
Design and Analysis of Algorithms-DP,Backtracking,Graphs,B&B
Sreedhar Chowdam
 
Planning Of Procurement o different goods and services
Planning Of Procurement o different goods and servicesPlanning Of Procurement o different goods and services
Planning Of Procurement o different goods and services
JoytuBarua2
 
WATER CRISIS and its solutions-pptx 1234
WATER CRISIS and its solutions-pptx 1234WATER CRISIS and its solutions-pptx 1234
WATER CRISIS and its solutions-pptx 1234
AafreenAbuthahir2
 
Gen AI Study Jams _ For the GDSC Leads in India.pdf
Gen AI Study Jams _ For the GDSC Leads in India.pdfGen AI Study Jams _ For the GDSC Leads in India.pdf
Gen AI Study Jams _ For the GDSC Leads in India.pdf
gdsczhcet
 
MCQ Soil mechanics questions (Soil shear strength).pdf
MCQ Soil mechanics questions (Soil shear strength).pdfMCQ Soil mechanics questions (Soil shear strength).pdf
MCQ Soil mechanics questions (Soil shear strength).pdf
Osamah Alsalih
 
一比一原版(IIT毕业证)伊利诺伊理工大学毕业证成绩单专业办理
一比一原版(IIT毕业证)伊利诺伊理工大学毕业证成绩单专业办理一比一原版(IIT毕业证)伊利诺伊理工大学毕业证成绩单专业办理
一比一原版(IIT毕业证)伊利诺伊理工大学毕业证成绩单专业办理
zwunae
 
Governing Equations for Fundamental Aerodynamics_Anderson2010.pdf
Governing Equations for Fundamental Aerodynamics_Anderson2010.pdfGoverning Equations for Fundamental Aerodynamics_Anderson2010.pdf
Governing Equations for Fundamental Aerodynamics_Anderson2010.pdf
WENKENLI1
 
RAT: Retrieval Augmented Thoughts Elicit Context-Aware Reasoning in Long-Hori...
RAT: Retrieval Augmented Thoughts Elicit Context-Aware Reasoning in Long-Hori...RAT: Retrieval Augmented Thoughts Elicit Context-Aware Reasoning in Long-Hori...
RAT: Retrieval Augmented Thoughts Elicit Context-Aware Reasoning in Long-Hori...
thanhdowork
 
ASME IX(9) 2007 Full Version .pdf
ASME IX(9)  2007 Full Version       .pdfASME IX(9)  2007 Full Version       .pdf
ASME IX(9) 2007 Full Version .pdf
AhmedHussein950959
 
HYDROPOWER - Hydroelectric power generation
HYDROPOWER - Hydroelectric power generationHYDROPOWER - Hydroelectric power generation
HYDROPOWER - Hydroelectric power generation
Robbie Edward Sayers
 
Water Industry Process Automation and Control Monthly - May 2024.pdf
Water Industry Process Automation and Control Monthly - May 2024.pdfWater Industry Process Automation and Control Monthly - May 2024.pdf
Water Industry Process Automation and Control Monthly - May 2024.pdf
Water Industry Process Automation & Control
 
Student information management system project report ii.pdf
Student information management system project report ii.pdfStudent information management system project report ii.pdf
Student information management system project report ii.pdf
Kamal Acharya
 
Investor-Presentation-Q1FY2024 investor presentation document.pptx
Investor-Presentation-Q1FY2024 investor presentation document.pptxInvestor-Presentation-Q1FY2024 investor presentation document.pptx
Investor-Presentation-Q1FY2024 investor presentation document.pptx
AmarGB2
 

Recently uploaded (20)

Final project report on grocery store management system..pdf
Final project report on grocery store management system..pdfFinal project report on grocery store management system..pdf
Final project report on grocery store management system..pdf
 
ethical hacking-mobile hacking methods.ppt
ethical hacking-mobile hacking methods.pptethical hacking-mobile hacking methods.ppt
ethical hacking-mobile hacking methods.ppt
 
Standard Reomte Control Interface - Neometrix
Standard Reomte Control Interface - NeometrixStandard Reomte Control Interface - Neometrix
Standard Reomte Control Interface - Neometrix
 
Pile Foundation by Venkatesh Taduvai (Sub Geotechnical Engineering II)-conver...
Pile Foundation by Venkatesh Taduvai (Sub Geotechnical Engineering II)-conver...Pile Foundation by Venkatesh Taduvai (Sub Geotechnical Engineering II)-conver...
Pile Foundation by Venkatesh Taduvai (Sub Geotechnical Engineering II)-conver...
 
ethical hacking in wireless-hacking1.ppt
ethical hacking in wireless-hacking1.pptethical hacking in wireless-hacking1.ppt
ethical hacking in wireless-hacking1.ppt
 
Top 10 Oil and Gas Projects in Saudi Arabia 2024.pdf
Top 10 Oil and Gas Projects in Saudi Arabia 2024.pdfTop 10 Oil and Gas Projects in Saudi Arabia 2024.pdf
Top 10 Oil and Gas Projects in Saudi Arabia 2024.pdf
 
English lab ppt no titlespecENG PPTt.pdf
English lab ppt no titlespecENG PPTt.pdfEnglish lab ppt no titlespecENG PPTt.pdf
English lab ppt no titlespecENG PPTt.pdf
 
Design and Analysis of Algorithms-DP,Backtracking,Graphs,B&B
Design and Analysis of Algorithms-DP,Backtracking,Graphs,B&BDesign and Analysis of Algorithms-DP,Backtracking,Graphs,B&B
Design and Analysis of Algorithms-DP,Backtracking,Graphs,B&B
 
Planning Of Procurement o different goods and services
Planning Of Procurement o different goods and servicesPlanning Of Procurement o different goods and services
Planning Of Procurement o different goods and services
 
WATER CRISIS and its solutions-pptx 1234
WATER CRISIS and its solutions-pptx 1234WATER CRISIS and its solutions-pptx 1234
WATER CRISIS and its solutions-pptx 1234
 
Gen AI Study Jams _ For the GDSC Leads in India.pdf
Gen AI Study Jams _ For the GDSC Leads in India.pdfGen AI Study Jams _ For the GDSC Leads in India.pdf
Gen AI Study Jams _ For the GDSC Leads in India.pdf
 
MCQ Soil mechanics questions (Soil shear strength).pdf
MCQ Soil mechanics questions (Soil shear strength).pdfMCQ Soil mechanics questions (Soil shear strength).pdf
MCQ Soil mechanics questions (Soil shear strength).pdf
 
一比一原版(IIT毕业证)伊利诺伊理工大学毕业证成绩单专业办理
一比一原版(IIT毕业证)伊利诺伊理工大学毕业证成绩单专业办理一比一原版(IIT毕业证)伊利诺伊理工大学毕业证成绩单专业办理
一比一原版(IIT毕业证)伊利诺伊理工大学毕业证成绩单专业办理
 
Governing Equations for Fundamental Aerodynamics_Anderson2010.pdf
Governing Equations for Fundamental Aerodynamics_Anderson2010.pdfGoverning Equations for Fundamental Aerodynamics_Anderson2010.pdf
Governing Equations for Fundamental Aerodynamics_Anderson2010.pdf
 
RAT: Retrieval Augmented Thoughts Elicit Context-Aware Reasoning in Long-Hori...
RAT: Retrieval Augmented Thoughts Elicit Context-Aware Reasoning in Long-Hori...RAT: Retrieval Augmented Thoughts Elicit Context-Aware Reasoning in Long-Hori...
RAT: Retrieval Augmented Thoughts Elicit Context-Aware Reasoning in Long-Hori...
 
ASME IX(9) 2007 Full Version .pdf
ASME IX(9)  2007 Full Version       .pdfASME IX(9)  2007 Full Version       .pdf
ASME IX(9) 2007 Full Version .pdf
 
HYDROPOWER - Hydroelectric power generation
HYDROPOWER - Hydroelectric power generationHYDROPOWER - Hydroelectric power generation
HYDROPOWER - Hydroelectric power generation
 
Water Industry Process Automation and Control Monthly - May 2024.pdf
Water Industry Process Automation and Control Monthly - May 2024.pdfWater Industry Process Automation and Control Monthly - May 2024.pdf
Water Industry Process Automation and Control Monthly - May 2024.pdf
 
Student information management system project report ii.pdf
Student information management system project report ii.pdfStudent information management system project report ii.pdf
Student information management system project report ii.pdf
 
Investor-Presentation-Q1FY2024 investor presentation document.pptx
Investor-Presentation-Q1FY2024 investor presentation document.pptxInvestor-Presentation-Q1FY2024 investor presentation document.pptx
Investor-Presentation-Q1FY2024 investor presentation document.pptx
 

Your data structures are made of maths!