Pass monad into generator

Allows you to write abstract functions