add documentation, remove dependency on monad-primitive