SlideShare une entreprise Scribd logo
1  sur  196
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/

Contenu connexe

Tendances

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 2Hang Zhao
 
Contravariant functors in scala
Contravariant functors in scalaContravariant functors in scala
Contravariant functors in scalaPiotr 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 interrelationPhilip Schwarz
 
Monad Transformers - Part 1
Monad Transformers - Part 1Monad Transformers - Part 1
Monad Transformers - Part 1Philip Schwarz
 
Sequence and Traverse - Part 1
Sequence and Traverse - Part 1Sequence and Traverse - Part 1
Sequence and Traverse - Part 1Philip Schwarz
 
Sequence and Traverse - Part 3
Sequence and Traverse - Part 3Sequence and Traverse - Part 3
Sequence and Traverse - Part 3Philip 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 generatorsPhilip 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 FreeKelley Robinson
 
Scala. Introduction to FP. Monads
Scala. Introduction to FP. MonadsScala. Introduction to FP. Monads
Scala. Introduction to FP. MonadsKirill Kozlov
 
Functionsandpigeonholeprinciple
FunctionsandpigeonholeprincipleFunctionsandpigeonholeprinciple
FunctionsandpigeonholeprincipleShiwani Gupta
 
Type Parameterization
Type ParameterizationType Parameterization
Type ParameterizationKnoldus Inc.
 
Effective way to code in Scala
Effective way to code in ScalaEffective way to code in Scala
Effective way to code in ScalaKnoldus 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
 

Tendances (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
 

En vedette

Running Free with the Monads
Running Free with the MonadsRunning Free with the Monads
Running Free with the Monadskenbot
 
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 functionskenbot
 
The Yoneda lemma and String diagrams
The Yoneda lemma and String diagramsThe Yoneda lemma and String diagrams
The Yoneda lemma and String diagramsRay 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 REAkenbot
 
Programming Methodology
Programming MethodologyProgramming Methodology
Programming Methodologyarchikabhatia
 
Link Walking with Riak
Link Walking with RiakLink Walking with Riak
Link Walking with RiakSusan Potter
 
Distributed Developer Workflows using Git
Distributed Developer Workflows using GitDistributed Developer Workflows using Git
Distributed Developer Workflows using GitSusan Potter
 
Dynamo: Not Just For Datastores
Dynamo: Not Just For DatastoresDynamo: Not Just For Datastores
Dynamo: Not Just For DatastoresSusan 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 CoffeeScriptSusan 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 2016Susan 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 PipeSusan 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 NixOSSusan Potter
 
Designing for Concurrency
Designing for ConcurrencyDesigning for Concurrency
Designing for ConcurrencySusan Potter
 
Functional Algebra: Monoids Applied
Functional Algebra: Monoids AppliedFunctional Algebra: Monoids Applied
Functional Algebra: Monoids AppliedSusan Potter
 
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 marketingCleverLEAF
 
Scala Data Pipelines @ Spotify
Scala Data Pipelines @ SpotifyScala Data Pipelines @ Spotify
Scala Data Pipelines @ SpotifyNeville Li
 

En vedette (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
 

Similaire à Your data structures are made of maths!

Monoids, monoids, monoids
Monoids, monoids, monoidsMonoids, monoids, monoids
Monoids, monoids, monoidsLuka Jacobowitz
 
Monoids, Monoids, Monoids - ScalaLove 2020
Monoids, Monoids, Monoids - ScalaLove 2020Monoids, Monoids, Monoids - ScalaLove 2020
Monoids, Monoids, Monoids - ScalaLove 2020Luka 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
 
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 practiceMartin 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 traverseLuka 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 worldDebasish Ghosh
 
Answers Of Discrete Mathematics
Answers Of Discrete MathematicsAnswers Of Discrete Mathematics
Answers Of Discrete MathematicsSabrina Green
 
6.5 determinant x
6.5 determinant x6.5 determinant x
6.5 determinant xmath260
 
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 NotesMax De Marzi
 
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 intergersLiveOnlineClassesInd
 
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-sanghLiveOnlineClassesInd
 
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 mathematicNaralaswapna
 

Similaire à 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
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
 
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
 
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
 

Plus de kenbot

Grow your own tech leads
Grow your own tech leadsGrow your own tech leads
Grow your own tech leadskenbot
 
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 compositionalitykenbot
 
Responsible DI: Ditch the Frameworks
Responsible DI: Ditch the FrameworksResponsible DI: Ditch the Frameworks
Responsible DI: Ditch the Frameworkskenbot
 
FP adoption at REA
FP adoption at REAFP adoption at REA
FP adoption at REAkenbot
 
Lenses for the masses - introducing Goggles
Lenses for the masses - introducing GogglesLenses for the masses - introducing Goggles
Lenses for the masses - introducing Goggleskenbot
 
Good functional programming is good programming
Good functional programming is good programmingGood functional programming is good programming
Good functional programming is good programmingkenbot
 
Imagine a world without mocks
Imagine a world without mocksImagine a world without mocks
Imagine a world without mockskenbot
 
The disaster of mutable state
The disaster of mutable stateThe disaster of mutable state
The disaster of mutable statekenbot
 

Plus de 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
 

Dernier

Biology for Computer Engineers Course Handout.pptx
Biology for Computer Engineers Course Handout.pptxBiology for Computer Engineers Course Handout.pptx
Biology for Computer Engineers Course Handout.pptxDeepakSakkari2
 
Concrete Mix Design - IS 10262-2019 - .pptx
Concrete Mix Design - IS 10262-2019 - .pptxConcrete Mix Design - IS 10262-2019 - .pptx
Concrete Mix Design - IS 10262-2019 - .pptxKartikeyaDwivedi3
 
Risk Assessment For Installation of Drainage Pipes.pdf
Risk Assessment For Installation of Drainage Pipes.pdfRisk Assessment For Installation of Drainage Pipes.pdf
Risk Assessment For Installation of Drainage Pipes.pdfROCENODodongVILLACER
 
Instrumentation, measurement and control of bio process parameters ( Temperat...
Instrumentation, measurement and control of bio process parameters ( Temperat...Instrumentation, measurement and control of bio process parameters ( Temperat...
Instrumentation, measurement and control of bio process parameters ( Temperat...121011101441
 
Past, Present and Future of Generative AI
Past, Present and Future of Generative AIPast, Present and Future of Generative AI
Past, Present and Future of Generative AIabhishek36461
 
CCS355 Neural Network & Deep Learning Unit II Notes with Question bank .pdf
CCS355 Neural Network & Deep Learning Unit II Notes with Question bank .pdfCCS355 Neural Network & Deep Learning Unit II Notes with Question bank .pdf
CCS355 Neural Network & Deep Learning Unit II Notes with Question bank .pdfAsst.prof M.Gokilavani
 
Churning of Butter, Factors affecting .
Churning of Butter, Factors affecting  .Churning of Butter, Factors affecting  .
Churning of Butter, Factors affecting .Satyam Kumar
 
Artificial-Intelligence-in-Electronics (K).pptx
Artificial-Intelligence-in-Electronics (K).pptxArtificial-Intelligence-in-Electronics (K).pptx
Artificial-Intelligence-in-Electronics (K).pptxbritheesh05
 
Oxy acetylene welding presentation note.
Oxy acetylene welding presentation note.Oxy acetylene welding presentation note.
Oxy acetylene welding presentation note.eptoze12
 
Introduction to Machine Learning Unit-3 for II MECH
Introduction to Machine Learning Unit-3 for II MECHIntroduction to Machine Learning Unit-3 for II MECH
Introduction to Machine Learning Unit-3 for II MECHC Sai Kiran
 
Application of Residue Theorem to evaluate real integrations.pptx
Application of Residue Theorem to evaluate real integrations.pptxApplication of Residue Theorem to evaluate real integrations.pptx
Application of Residue Theorem to evaluate real integrations.pptx959SahilShah
 
Work Experience-Dalton Park.pptxfvvvvvvv
Work Experience-Dalton Park.pptxfvvvvvvvWork Experience-Dalton Park.pptxfvvvvvvv
Work Experience-Dalton Park.pptxfvvvvvvvLewisJB
 
Comparative Analysis of Text Summarization Techniques
Comparative Analysis of Text Summarization TechniquesComparative Analysis of Text Summarization Techniques
Comparative Analysis of Text Summarization Techniquesugginaramesh
 
Decoding Kotlin - Your guide to solving the mysterious in Kotlin.pptx
Decoding Kotlin - Your guide to solving the mysterious in Kotlin.pptxDecoding Kotlin - Your guide to solving the mysterious in Kotlin.pptx
Decoding Kotlin - Your guide to solving the mysterious in Kotlin.pptxJoão Esperancinha
 
Correctly Loading Incremental Data at Scale
Correctly Loading Incremental Data at ScaleCorrectly Loading Incremental Data at Scale
Correctly Loading Incremental Data at ScaleAlluxio, Inc.
 
Sachpazis Costas: Geotechnical Engineering: A student's Perspective Introduction
Sachpazis Costas: Geotechnical Engineering: A student's Perspective IntroductionSachpazis Costas: Geotechnical Engineering: A student's Perspective Introduction
Sachpazis Costas: Geotechnical Engineering: A student's Perspective IntroductionDr.Costas Sachpazis
 

Dernier (20)

Biology for Computer Engineers Course Handout.pptx
Biology for Computer Engineers Course Handout.pptxBiology for Computer Engineers Course Handout.pptx
Biology for Computer Engineers Course Handout.pptx
 
Concrete Mix Design - IS 10262-2019 - .pptx
Concrete Mix Design - IS 10262-2019 - .pptxConcrete Mix Design - IS 10262-2019 - .pptx
Concrete Mix Design - IS 10262-2019 - .pptx
 
Risk Assessment For Installation of Drainage Pipes.pdf
Risk Assessment For Installation of Drainage Pipes.pdfRisk Assessment For Installation of Drainage Pipes.pdf
Risk Assessment For Installation of Drainage Pipes.pdf
 
Instrumentation, measurement and control of bio process parameters ( Temperat...
Instrumentation, measurement and control of bio process parameters ( Temperat...Instrumentation, measurement and control of bio process parameters ( Temperat...
Instrumentation, measurement and control of bio process parameters ( Temperat...
 
Past, Present and Future of Generative AI
Past, Present and Future of Generative AIPast, Present and Future of Generative AI
Past, Present and Future of Generative AI
 
CCS355 Neural Network & Deep Learning Unit II Notes with Question bank .pdf
CCS355 Neural Network & Deep Learning Unit II Notes with Question bank .pdfCCS355 Neural Network & Deep Learning Unit II Notes with Question bank .pdf
CCS355 Neural Network & Deep Learning Unit II Notes with Question bank .pdf
 
Churning of Butter, Factors affecting .
Churning of Butter, Factors affecting  .Churning of Butter, Factors affecting  .
Churning of Butter, Factors affecting .
 
Artificial-Intelligence-in-Electronics (K).pptx
Artificial-Intelligence-in-Electronics (K).pptxArtificial-Intelligence-in-Electronics (K).pptx
Artificial-Intelligence-in-Electronics (K).pptx
 
Oxy acetylene welding presentation note.
Oxy acetylene welding presentation note.Oxy acetylene welding presentation note.
Oxy acetylene welding presentation note.
 
Introduction to Machine Learning Unit-3 for II MECH
Introduction to Machine Learning Unit-3 for II MECHIntroduction to Machine Learning Unit-3 for II MECH
Introduction to Machine Learning Unit-3 for II MECH
 
Application of Residue Theorem to evaluate real integrations.pptx
Application of Residue Theorem to evaluate real integrations.pptxApplication of Residue Theorem to evaluate real integrations.pptx
Application of Residue Theorem to evaluate real integrations.pptx
 
Work Experience-Dalton Park.pptxfvvvvvvv
Work Experience-Dalton Park.pptxfvvvvvvvWork Experience-Dalton Park.pptxfvvvvvvv
Work Experience-Dalton Park.pptxfvvvvvvv
 
Comparative Analysis of Text Summarization Techniques
Comparative Analysis of Text Summarization TechniquesComparative Analysis of Text Summarization Techniques
Comparative Analysis of Text Summarization Techniques
 
young call girls in Green Park🔝 9953056974 🔝 escort Service
young call girls in Green Park🔝 9953056974 🔝 escort Serviceyoung call girls in Green Park🔝 9953056974 🔝 escort Service
young call girls in Green Park🔝 9953056974 🔝 escort Service
 
Decoding Kotlin - Your guide to solving the mysterious in Kotlin.pptx
Decoding Kotlin - Your guide to solving the mysterious in Kotlin.pptxDecoding Kotlin - Your guide to solving the mysterious in Kotlin.pptx
Decoding Kotlin - Your guide to solving the mysterious in Kotlin.pptx
 
🔝9953056974🔝!!-YOUNG call girls in Rajendra Nagar Escort rvice Shot 2000 nigh...
🔝9953056974🔝!!-YOUNG call girls in Rajendra Nagar Escort rvice Shot 2000 nigh...🔝9953056974🔝!!-YOUNG call girls in Rajendra Nagar Escort rvice Shot 2000 nigh...
🔝9953056974🔝!!-YOUNG call girls in Rajendra Nagar Escort rvice Shot 2000 nigh...
 
POWER SYSTEMS-1 Complete notes examples
POWER SYSTEMS-1 Complete notes  examplesPOWER SYSTEMS-1 Complete notes  examples
POWER SYSTEMS-1 Complete notes examples
 
Correctly Loading Incremental Data at Scale
Correctly Loading Incremental Data at ScaleCorrectly Loading Incremental Data at Scale
Correctly Loading Incremental Data at Scale
 
Sachpazis Costas: Geotechnical Engineering: A student's Perspective Introduction
Sachpazis Costas: Geotechnical Engineering: A student's Perspective IntroductionSachpazis Costas: Geotechnical Engineering: A student's Perspective Introduction
Sachpazis Costas: Geotechnical Engineering: A student's Perspective Introduction
 
young call girls in Rajiv Chowk🔝 9953056974 🔝 Delhi escort Service
young call girls in Rajiv Chowk🔝 9953056974 🔝 Delhi escort Serviceyoung call girls in Rajiv Chowk🔝 9953056974 🔝 Delhi escort Service
young call girls in Rajiv Chowk🔝 9953056974 🔝 Delhi escort Service
 

Your data structures are made of maths!