3 ms·
That's known in Haskell as the List monad. There's a function to transform Maybe (like Rust's Option) to lists. In Haskell, lists can be infinitely long. Rega
by kmill 7y ago
That's known in Haskell as the List monad. There's a function to transform Maybe (like Rust's Option) to lists. In Haskell, lists can be infinitely long.
Regarding the IO monad, Simon Peyton Jones has an article explaining why they went with that rather than streams. Sadly I don't remember what it was, but it had something to do with proper interleaving of input and output. (Btw, in a way, the IO monad is a stream of commands to the RTS.)