The Monadist

Juan Carlos Hinojo

The monad

  • Abstract data structure
  • Comes from functional programming language (Haskell)
  • Its just an object which allows you to chain a sequence of operations

3 basic rules

What can we use a monad for?
(Black magic)

Not useful at all...

Maybe-Monad

Everyone has got into a Method called on nil exception

Nested Data structures

fetch
 

Only works for hashes

try

Maybe-Monad

How can a Maybe-Monad help us?

also we can spot some repeated code right there...

I would still prefer to go with using try or fetch...

Fmap

With fmap

Method missing

With method missing

If you use the monad as a module

What about lists?

Every word in every comment

Lets Apply a monad

Using the monad

Fmap

With Method missing

Using it as a module

Yes! there is a gem

We are hiring :)

Thank you

Monadist

By Juan Carlos Hinojo