3 ms·
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 bind
by posix_monad 2y ago
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!
- nyssos 2y agoYou don't need to bind everything. The corresponding Haskell code is manager <- fetch_manager =<< fetch_user
- posix_monad 2y agoWhy have do-notation if we can use fancy operators for everything? I think this version would is less approachable for most developers.