Slide 1

Slide 1 text

Mo’Problems, Mo’nads getify (kyle simpson)

Slide 2

Slide 2 text

"Some people, when confronted with a problem, think 'I know, I'll use regular expressions.' Now they have two problems." -- Jamie Zawinski

Slide 3

Slide 3 text

regexes get a bad rap

Slide 4

Slide 4 text

No content

Slide 5

Slide 5 text

“right tool … blah blah…” specialized vs generalized

Slide 6

Slide 6 text

"Technology is a word that describes something that doesn't work yet." -- Douglas Adams

Slide 7

Slide 7 text

Monads unit(a) >>= λx → f(x) ↔ f(a) ma >>= λx → unit(x) ↔ ma ma >>= λx → (f(x) >>= λy → g(y)) ↔ (ma >>= λx → f(x)) >>= λy → g(y)

Slide 8

Slide 8 text

"a monad is just a monoid in the category of endofunctors."

Slide 9

Slide 9 text

"algebras, and categories, and type theory… oh my!"

Slide 10

Slide 10 text

No content

Slide 11

Slide 11 text

there’s only one right way to explain monads!

Slide 12

Slide 12 text

types vs values

Slide 13

Slide 13 text

types: behaviors we can expect values: behaviors we can use

Slide 14

Slide 14 text

what does monad mean? the Monad (type/interface) vs a monad (value)

Slide 15

Slide 15 text

the Monad: 3 laws a monad: data structure

Slide 16

Slide 16 text

https://github.com/getify/Monio

Slide 17

Slide 17 text

No content

Slide 18

Slide 18 text

monads & friends

Slide 19

Slide 19 text

No content

Slide 20

Slide 20 text

why monads?

Slide 21

Slide 21 text

1. choose a value or fallback? 2. gracefully handle exceptions? 3. manage side effects? how could I...

Slide 22

Slide 22 text

1. choose a value or fallback? Maybe Monad

Slide 23

Slide 23 text

No content

Slide 24

Slide 24 text

No content

Slide 25

Slide 25 text

No content

Slide 26

Slide 26 text

2. gracefully handle exceptions? Either Monad

Slide 27

Slide 27 text

No content

Slide 28

Slide 28 text

3. manage side effects? IO Monad

Slide 29

Slide 29 text

No content

Slide 30

Slide 30 text

No content

Slide 31

Slide 31 text

https://codepen.io/getify/pen/VwjyoMY?editors=0011 3. IO + Maybe + Either + ...

Slide 32

Slide 32 text

No content