Haskell: Difference between revisions

Pigs (talk | contribs)
Limitations: Add section on ghcup
Pigs (talk | contribs)
m Use lang=haskell for syntax highlight
Line 26: Line 26:


For simple scripts, you can directly use nix-shell to get a redistributable Haskell script that you can run on any Nix system with <code>./my-script.hs</code>:
For simple scripts, you can directly use nix-shell to get a redistributable Haskell script that you can run on any Nix system with <code>./my-script.hs</code>:
<syntaxhighlight lang=bash>
<syntaxhighlight lang=haskell>
#!/usr/bin/env nix-shell
#!/usr/bin/env nix-shell
#!nix-shell --pure -i runghc -p "haskellPackages.ghcWithPackages (pkgs: [ pkgs.turtle ])"
#!nix-shell --pure -i runghc -p "haskellPackages.ghcWithPackages (pkgs: [ pkgs.turtle ])"