Monoid protocol

Monoids have two principle operations: empty/zero and append.

This protocol doesn’t have an empty function due to the limitations of Elixir protocols. I can implement this functionality using Behaviours, but I haven’t done so yet.

Source

Summary

mappend(monoid1, monoid2)

Takes two monoids and concatenates them

Types

t :: term

Functions

mappend(monoid1, monoid2)

Specs:

  • mappend(t, t) :: t

Takes two monoids and concatenates them.

All collections, such as lists and strings, are monoids. Many other types are monoids too.

Source