Scala implementation of sorted streams as a monad.