3 ms·
The way I think about effectful computation and IO in Haskell is as a kind of enforced metaprogramming. The actual language comprises a strongly typed meta-laye
by mppm 2y ago
The way I think about effectful computation and IO in Haskell is as a kind of enforced metaprogramming. The actual language comprises a strongly typed meta-layer used to assemble an imperative program from opaque primitives. Like all powerful metaprogramming systems, this allows doing things you cannot easily do in a first-order imperative language. On the other hand, this makes all the 99% of simple stuff you don't have to even think about in an imperative language necessarily roundabout, and imposes a steep learning curve. Which contributes to the empirical fact that not many people are rushing to use Haskell, the superior imperative language, in real-world projects.
- tome 2y ago> The way I think about effectful computation and IO in Haskell is as a kind of enforced metaprogramming If you think of effectful computation in Haskell to be a sort of metaprogramming, then indeed it will seem very complex, absurdly complex actually. If you think of it as just the same as programming in any other language, except functions that do effects are tagged with a type that indicates that, then I think things will appear much simpler. I prefer thinking of it as the latter, and it's been very effective (pun half intended) for me.