wiz*_*zup 8 nixos purescript nix
我想安装hello world项目,purescript在NixOs和有对夫妇的问题,
purescript网站建议安装通过,npm但没有nixos.nodePackages.purescript,相反,我找到至少2个变种nixpkgs
有什么不同?
pulp和bower通过,npm但只有nodePackages.bower可用,并且没有证件psc-package.应该nix如何处理purescript包?
hello.purs)甚至没有编译,有这些错误.
$ 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"
Run Code Online (Sandbox Code Playgroud)
我添加module Hello到代码但仍然失败.
$ 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.
Run Code Online (Sandbox Code Playgroud)
应该如何正确的工作流程?
目标是hello.purs
在Web浏览器中运行一个最小的示例项目.
这是 hello.purs
module Hello where
import Prelude
import Control.Monad.Eff.Console (log)
greet :: String -> String
greet name = "Hello, " <> name <> "!"
main = log (greet "World")
Run Code Online (Sandbox Code Playgroud)
这将是非常有益的,如果你也可以提供shell.nix为nix-shell或default.nix为nix-build.
发现这个2岁的公会,我正在尝试但我仍然没有回答我的所有问题.
npm install pulp- 二进制文件将安装到node_modules/.bin/pulpbower install purescript-prelude purescript-console。但node_modules/.bin/pulp init会给你一个 Bower 文件,你可以运行bower install给你一个基本的项目。然后,您可以node_modules/.bin/pulp run使用 node.js 来执行它,但您可能想要pulp browserify --to example.js获取一个可以放入<script>HTML 标签中的文件。