-
Notifications
You must be signed in to change notification settings - Fork 462
Closed as duplicate of#1385
Labels
feature-requestUser wanted featuresUser wanted features
Description
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" |> runThis could make OCaml a nice replacement for shell scripts.
Metadata
Metadata
Assignees
Labels
feature-requestUser wanted featuresUser wanted features