Haskell: Difference between revisions
→Scripting: Swap (legacy?) `haskellPackages.ghcWithPackages` for `ghc.withPackages` and add better starting examples for shell scripting with Haskell, using `Shh` in addition to `Turtle`. |
This flow chart is wrong or at least so much oversimplified that it is actively misleading |
||
| (One intermediate revision by one other user not shown) | |||
| Line 4: | Line 4: | ||
== How to develop with Haskell and Nix == | == How to develop with Haskell and Nix == | ||
{{Note|{{nixos:package|haskellPackages}} is a synonym of <code>haskell.packages.ghcXYZ</code> where <code>XYZ</code> is the current default version of GHC in nixpkgs. However you can use a different version by replacing <code>haskellPackages</code> with the wanted package, for instance use <code>haskell.compiler.ghc884</code> to use GHC 8.8.4. You can get the full list of available GHC versions using: | {{Note|{{nixos:package|haskellPackages}} is a synonym of <code>haskell.packages.ghcXYZ</code> where <code>XYZ</code> is the current default version of GHC in nixpkgs. However you can use a different version by replacing <code>haskellPackages</code> with the wanted package, for instance use <code>haskell.compiler.ghc884</code> to use GHC 8.8.4. You can get the full list of available GHC versions using: | ||
| Line 39: | Line 35: | ||
... | ... | ||
(ghc.withPackages (hsPkgs: with hsPkgs; [ | (ghc.withPackages (hsPkgs: with hsPkgs; [ | ||
turtle | turtle # Faster startup time with all external shell commands | ||
shh | shh # Piping operators and other goodies | ||
... | shh-extras # Try shh as an interactive shell | ||
... # ...anything else you want! | |||
]) | ]) | ||
]; | ]; | ||