from Hacker News

Interesting languages and their selling points

by overlisted on 7/30/22, 4:13 PM with 1 comments

  • by Laaas on 7/30/22, 6:36 PM

    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/.