I still don't see why this is better (in any reasonable metric) than just plain Bash. Is there really any type safety we gain here? Is it more convenient than Bash? The only thing I see is the argument about quoting arguments.
Forgive me for assuming you aren't a Haskeller and therefore aren't part of the target audience (maybe you are), but I'll try make up for the assumption by elaborating some general benefits.
The process arguments aren't type-safe, no. But the code that uses them can be. I can also use existing Haskell libraries mixed with this (which are type-safe). For example:
This line streams lines from foo.txt, parses each one with the CSV conduit parser[1], takes the second value and then feeds that into grep which spits out only columns which match the regex ^4. Or if I wanted to match only valid email addresses, I could import Text.Email.Validate and use this conduit:
… $= CL.filter isValid $= …
Which, again, comes from a normal Haskell package[2] which validates RFC 5322 emails with a full parser. I can also just extract the domain part of valid emails:
I'm operating on structured, well-typed data in between normal UNIX pipes, in a streaming manner. I think that's pretty sexy.
Finally, when I decide this script is getting more complex than a mere script, I don't have to worry about maintaining it or refactoring it. I'm already using Haskell!
There's also the personal benefit to me, my editor support for Haskell is very good. Editor support for Bash is comparatively lacking.
I don't think it's more convenient than Bash if you take a myopic view of scripts that you write.
Hey nice examples. However those examples only show that you are already operating/programming outside of the target use case of a Bash script -- and that's why a general-purpose language like Haskell comes in handy. IMO if one is to fully operate within the scripting level and to not worry about more complicated processing, Bash is easier. So I'm saying this is not really an apple-to-apple comparison.
Fair. That's partly what motivated my desire to be able to script within Haskell in the first place, I often find myself tredding that gray area. Half way through a Bash script (or a pipe chain) before realising I can't express what I want to express. A bunch of times I've given up and started writing a Haskell file. That's my personal experience, anyway. So I'd rather avoid bumping my head on the ceiling altogether.