3 ms·
Why? Haskell has excellent performance for IO.
by Peaker 14y ago
Why? Haskell has excellent performance for IO.
- eru 14y agoDepends on what level of abstraction you want to be at. If you use C-style IO, that's fine, but low level. If you use lazy-IO, that unfortunately made it into the Prelude, forget your performance. The Right Way is to use enumerators / left-fold based IO, or the pipe or conduit packages. But that's not trivial, yet. (Though not insanely hard, either.)
- Peaker 14y agoIt's not any worse than IO in other languages, which is the original topic.
- eru 14y agoLazy IO, which is what you get by default, if you just learn the language and use the Prelude, is worse than what you get in C.
- Peaker 14y agoSo Haskell makes IO harder by making you learn which modules use lazy I/O and avoid them? I can agree with that. But I don't think that's what people generally try to say when they claim IO in Haskell is hard or bad. People think the IO/effect segregation in Haskell makes IO bad or hard, when it's in fact just the opposite.