What does HackerNews think of effectful?

An easy to use, fast extensible effects library with seamless integration with the existing Haskell ecosystem.

Language: Haskell

#9 in Haskell
Also a much simpler alternative in my opinion to monad transformers is effectful:

https://github.com/haskell-effectful/effectful

Here's a talk on it:

https://www.youtube.com/watch?v=BUoYKBLOOrE

> Lets say you have a huge overly-convoluted Haskell program. Somewhere deep down a call hierachy of pure functions you need to print something to the console. That is not easy to refactor.

> Or vice-versa you have a huge convoluted program where everything happens inside an IO monad because at some point something is written to the console. Now you realize you dont need to write to the console.

These problems are essentially completely resolved these days by a modern effect system like effectful. Basically, they allow you to do arbitrary effects deep down a call stack with minimal plumbing (you still have adjust the types, as you should: that's the point of effect tracking!) and also to remove effects, so you can easily convert between pure code and "effectful code that just so happens to do no effects".

https://github.com/haskell-effectful/effectful

One thing the author fails to mention, is that monads can't _annotate_ the terms. They can not replace effects in the type system, since something `putStrLn` doesn't _cause_ an effect, it _returns_ it. In a strict language, even if you have something like `putStrLn :: String -> IO ()`, you can not do `let _ = putStrLn "d" in x` and have it not print it, unless `IO` wraps the computation in a lambda, which is quite suboptimal.

Hence, monads are not a replacement for effects, even if people are making things like https://github.com/haskell-effectful/effectful/.