|
|
|
|
|
by hyllos
939 days ago
|
|
I’ve turned some time ago a build and deploy script (single production server) some bash scripts into Haskell using Turtle [1].
What I enjoyed was the ability to reduce redundancies significantly.
It was significantly shorter code afterwards. [1] https://hackage.haskell.org/package/turtle |
|
Afaik a Turtle program has a single current directory, which makes it hard when you want to run concurrent jobs that need to be executed from particular directories. I partially solved the problem by using locks/queues/workers. But it got too much for me when Turtle started failing due to its current directory being deleted.
In contrast, typed-process lets you spawn separate processes, and execute within a working dir (rather than needing to cd there), so it works great for big, complicated workflows.
And it also has good support for OverloadedStrings, which means you can generally copy & paste what you would have typed into bash, and it just works.
I also use the interpolate package (with QuasiQuotes) to make the raw strings nicer in the source code, but it's not compatible with hlint, so I'm thinking of looking for a different package for string-handling.