News for hackers. Stuff that matters.
Re:Functional Semantics in Imperative Clothing (Richard Feld... by posix_monad on Monday April 29, 2024 @11:49AM (#40199872)
IIUIR, Roc's syntax is more ergonomic than do-notation.

In Roc, you can put a "!" (bind) pretty much anywhere, whereas in do-notation it must be part of a binding.

    current_user <- fetch_user
    manager <- fetch_manager current_user
Compared to

    manager <- fetch_manager (!fetch_user)
Please correct me if I'm wrong!
Re:Functional Semantics in Imperative Clothing (Richard Feld... by nyssos on Monday April 29, 2024 @11:44PM (#40207013)
You don't need to bind everything. The corresponding Haskell code is

    manager <- fetch_manager =<< fetch_user
Re:Functional Semantics in Imperative Clothing (Richard Feld... by posix_monad on Tuesday April 30, 2024 @09:24AM (#40210726)
Why have do-notation if we can use fancy operators for everything?

I think this version would is less approachable for most developers.