Re:Use Haskell for shell scripting
by lmm on Friday January 30, 2015 @05:04AM
(#8971295)
It's in a do block, so you can see that these are not simple function calls; they're being composed via some monad. In cases where you're actually chaining values together it's more obvious which things are which:
But the notation is a bit more magic for this "no return" case; I prefer the Scala approach where even if you don't care about the return values you'd have to write this as
[ Parent
| on HN ]
If you enable -Wall, Haskell forces you to use "_ <-" for any action that has a stateful result.
But the "let" vs no "let" is a pretty strong hint anyway :)
Control.Monad.void is your friend.