I am trying to set up a hello world project with purescript on NixOs and ask a couple of questions,
- The official
purescript website recommends installing through npm , but there is no nixos.nodePackages.purescript , instead there are at least 2 options that I found in nixpkgs- nixos.purescript
- nixos.haskellPackages.purescript
What are different?
- The official site recommends
pulp and bower via npm , but only nodePackages.bower is available and the psc-package is not documented.
What should be the nix way to handle purescript packages?
- The sample code on the official website (see
hello.purs below) does not even compile,
with this error.
$ purs compile hello.purs Error found: at hello.purs line 1, column 1 - line 1, column 1 Unable to parse module: unexpected "import" expecting "module"
I am adding module Hello to the code, but still failed.
$ purs compile hello.purs Error 1 of 2: in module Hello at hello.purs line 2, column 1 - line 2, column 15 Module Prelude was not found. Make sure the source file exists, and that it has been provided as an input to psc. See https://github.com/purescript/documentation/blob/master/errors/ModuleNotFound.md for more information, or to contribute content related to this error. Error 2 of 2: in module Hello at hello.purs line 3, column 1 - line 3, column 39 Module Control.Monad.Eff.Console was not found. Make sure the source file exists, and that it has been provided as an input to psc. See https://github.com/purescript/documentation/blob/master/errors/ModuleNotFound.md for more information, or to contribute content related to this error.
How should the correct workflow be?
The goal is to have a minimal sample project with one hello.purs running in a web browser.
This is hello.purs
module Hello where import Prelude import Control.Monad.Eff.Console (log) greet :: String -> String greet name = "Hello, " <> name <> "!" main = log (greet "World")
It would be very helpful if you can also provide shell.nix for nix-shell or default.nix for nix-build .
The guild found this for 2 years, I try, but I still do not have the answer to all my questions.
source share