adding function monad

I will be adding tests for this with the documentation update.