Are you familiar with Monads? In Haskell they are defined as datatypes. Monads are a general framework which can model different kinds of computation, including error handling, nondeterminism, and parsing with Haskell.
Cool Article on Wikibooks about Haskell/Monads
|Algebras/modules over a monad|
Given that a monad in a bicategory ℬ is nothing but a monoid in a hom-category ℬ(a,a), it is natural to consider a module over this monoid: a module for a monad. This notion of module is more general than a module in a monoidal category, however, since it need not live in ℬ(a,a) but can be in ℬ(b,a) (for left modules) or ℬ(a,c) (for right modules).
A free monad is a free object relative to a forgetful functor whose domain is a category of monads.