Reimplement sequence monad