Reimplement and test set monad