Jump to content

Haskell: Difference between revisions

827 bytes added ,  7 September 2023
m
I added a disclaimer that highlights a potential problem and solution with Stack for the users of NixOS on a stable channel
imported>Maralorn
(Fix links to official documentation)
imported>Kintrix
m (I added a disclaimer that highlights a potential problem and solution with Stack for the users of NixOS on a stable channel)
Line 83: Line 83:
}
}
</syntaxhighlight>
</syntaxhighlight>
'''Disclaimer''': For users of a stable version of NixOS there could be a problem where Stack tries to use a GHC version that is not yet in the given channel of Nixpkgs. Example at the time of writing: When using NixOS 23.05, Stack defaults to using the LTS-21.10 resolver, which uses <code>ghc-9.4.6</code>. However, the newest version of GHC in the 23.05 channel is <code>ghc-9.4.4</code>, thus Stack fails to execute some commands.
As a solution, [https://docs.haskellstack.org/en/stable/yaml_configuration/#resolver-or-snapshot specify a resolver in your `stack.yaml`] file that uses a GHC version available for your channel. You can find a list of snapshots on https://www.stackage.org/snapshots. Or alternatively, set the resolver as a command line argument, which is required for running commands such as `stack new`.


===  Using developPackage (use the nix packages set for haskell) ===
===  Using developPackage (use the nix packages set for haskell) ===
Anonymous user