We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Haskell's cabal supports this
#!/usr/bin/env cabal {- cabal: build-depends: base ^>= 4.11 , shelly ^>= 1.8.1 -} main :: IO () main = do ...
The script can be made executable and running it will automatically download and build dependencies, compile the script, and then execute it. Subsequent runs where the file hasn't been changed will use the cached compilation. More information here https://cabal.readthedocs.io/en/stable/getting-started.html#running-a-single-file-haskell-script
With the advent of dune package management, we could do the same thing. For example:
#!/usr/bin/env dune (* dune: (depends base feather) *) open Feather let () = process "ps" [] |. map_lines String.uppercase |. grep "BASH" |> run
This could make OCaml a nice replacement for shell scripts.
The text was updated successfully, but these errors were encountered:
@oberblastmeister Independently of any package management, this sounds like a nice feature for one-file projects!
Question: where does cabal store its build artifacts when running a one-file script in this way? Next to the script?
cabal
Sorry, something went wrong.
No branches or pull requests
Haskell's cabal supports this
The script can be made executable and running it will automatically download and build dependencies, compile the script, and then execute it. Subsequent runs where the file hasn't been changed will use the cached compilation. More information here https://cabal.readthedocs.io/en/stable/getting-started.html#running-a-single-file-haskell-script
With the advent of dune package management, we could do the same thing. For example:
This could make OCaml a nice replacement for shell scripts.
The text was updated successfully, but these errors were encountered: