r/functionalprogramming • u/newgoliath • Oct 10 '24
Question FP language for Unix Scripting?
I'm a Linux admin who wants to get into FP. Any languages out there that are strict FP (single assignment, etc) that will let me easily move around files, start and stop processes, shell out, etc.?
30
Upvotes
View all comments
Show parent comment
4
u/miyakohouou Oct 11 '24
I don't typically bother with cabal for scripts. For most of the things I quickly script I'm only really using
baseand maybedirectory,process,text,bytestringand maybeaeson. I use nixos and home manager, and I keep a haskell environment for my user set up with those and a few other haskell packages just for convenience.If I need other packages, or want to share a script with someone, I tend to just use a nix shebang:
If you put that in your file before
module Main whereand make the source file executable then it'll just run it in a nix environment with your dependencies.