Use Maybe when the output isn't guaranteed

Maybe wraps things into a context.

Maybe is a Functor

We won't go into much detail about the Applicative Typeclass

A Monoid is a function (•) that satisfies the following:

Which of the following are Monoids?

Try it out

In Haskell, the binary function is called mappend and its identity element is mempty

Prelude> import Data.Monoid Prelude Data.Monoid> [1,2,3] `mappend` [4,5,6] [1,2,3,4,5,6] Prelude Data.Monoid> [1,2,3] `mappend` mempty [1,2,3] Prelude Data.Monoid> mempty `mappend` [1,2,3] [1,2,3]

As you can see above, lists are Monoids.

Haskell is heavily influenced by mathematics. Monoids, Functors, and Monads all have roots in Category Theory.