You don't need an effect system
In a recent development, the author was granted permission to revamp a previously coded production system. The codebase, primarily written in Haskell, comprised various services communicating with one another. Despite the initial opinion that an effect system was necessary, the author later discovered that such a system was not essential for their project.
An effect system, as the author initially understood, aids in tracking effects, mocking, and ensuring internal consistency. However, after re-evaluating, the author realized that manual argument passing and the ST monad proved to be more than sufficient for their needs. The use of an effect system also did not contribute to a safer codebase, as it did not prevent developers from incorporating flawed IO operations or employing unsafePerformIO.
Moreover, the author did not utilize higher-order effects, which necessitate overlapping or nesting. The absence of these features in the author's project led to a streamlined approach, avoiding the need for a comprehensive effect system manual. The most significant role of an effect system in the author's codebase was error handling, which could be achieved through alternative methods, such as the Early pattern, without the added complexity of an effect system.
The author concluded that the effect system's primary purpose in their project was to handle errors, a function that could be accomplished through other means, such as the Early pattern or the handle pattern. The author's experience demonstrates that, while effect systems can be beneficial in certain situations, they may not always be necessary, especially in projects where simpler solutions can effectively address the required functionality.
Written by urgent.news from Lobsters's reporting — not their text. Machine-written — may contain errors; check the original before relying on it.