我刚开始学习purescript后purescript by example,但我坚持在Chapter2 using grunt project templates结束。 我按照说明进行操作,但是当我运行繁重的命令,我得到这个错误:purescript入门
/Users/chad/playground/purescript/tests/tmp/node_modules/Control.Monad.Eff.Random/index.js:8
return Math.random();
^
TypeError: undefined is not a function
at Object.random (/Users/chad/playground/purescript/tests/tmp/node_modules/Control.Monad.Eff.Random/index.js:8:17)
at __do (/Users/chad/playground/purescript/tests/tmp/node_modules/Test.QuickCheck/index.js:177:52)
at Object.__do (/Users/chad/playground/purescript/tests/tmp/node_modules/Main/index.js:19:201)
at Object.<anonymous> (/Users/chad/playground/purescript/tests/tmp/index.js:1:79)
at Module._compile (module.js:460:26)
at Object.Module._extensions..js (module.js:478:10)
at Module.load (module.js:355:32)
at Function.Module._load (module.js:310:12)
at Function.Module.runMain (module.js:501:10)
at startup (node.js:129:16)
Warning: -> error 1 /Users/chad/playground/purescript/tests/tmp/index.js (125ms) Use --force to continue.
Aborted due to warnings.
我发现通过挖掘到的代码是什么模块数学被导入到/output/Control.Monad.Eff.Random/index.js
作为
var Math = require("Math");
function random() {
return Math.random();
}
;
如果我删除导入,让数学原生并运行主要index.js
只需node index.js
,一切工作正常。 我想知道是否有什么我可以做,以解决这个问题在purescript,或者如果它是我做错了。
为什么是这个标签的[标签:哈斯克尔]?的确,PureScript与Haskell相关,而PureScript编译器是用Haskell编写的,但它们不是相同的语言。 – dfeuer 2015-02-12 04:31:20
我现在删除了haskell标签,我最初添加它是因为其他一些purescript问题正在使用该组合。 – 2015-02-12 04:42:23