我对Haskell这门语言有些熟悉,但对工具链不太熟悉。(在阴谋集团和堆栈存在之前,我曾和哈斯克尔一起玩过。)我听说堆栈是我应该用来管理Haskell项目的工具。我正在努力学习匆忙库,而且我在第一个教程中遇到了障碍,因为我无法安装H游乐场。我创建了一个堆栈项目;我的stack.yaml
extra-deps:
- ghc-simple-0.3
- haste-compiler-0.5.3
- shellmate-0.2.3
- haste-perch-0.1.0.9
- hplayground-0.1.3.1而且我的.cabal文件在构建依赖项中列出了h游乐场。但是,当我运行堆栈构建时,我会得到以下错误:
Configuring haste-perch-0.1.0.9...
Building haste-perch-0.1.0.9...
Preprocessing library haste-perch-0.1.0.9...
Haste/Perch.hs:17:15: Warning:
-XOverlappingInstances is deprecated: instead use per-instance pragmas OVERLAPPING/OVERLAPPABLE/OVERLAPS
Haste/App/Perch.hs:18:15: Warning:
-XOverlappingInstances is deprecated: instead use per-instance pragmas OVERLAPPING/OVERLAPPABLE/OVERLAPS
[1 of 2] Compiling Haste.App.Perch ( Haste/App/Perch.hs, .stack-work/dist/x86_64-osx/Cabal-1.22.4.0/build/Haste/App/Perch.o )
Haste/App/Perch.hs:61:15: Not in scope: ‘newTextElem’
Haste/App/Perch.hs:71:9:
Not in scope: ‘setAttr’
Perhaps you meant ‘jsSetAttr’ (imported from Haste.App)
Haste/App/Perch.hs:76:15:
Not in scope: ‘newElem’
Perhaps you meant one of these:
‘nelem’ (line 75), ‘notElem’ (imported from Prelude)还有很多类似的错误。对我做错了什么有什么想法吗?
更广泛地说:对于那些不熟悉Haskell工具链的人来说,什么是快速、便捷的起立和奔跑的方式?
发布于 2016-03-21 09:54:29
Haste的事件API在0.4到0.5系列之间被彻底修改,而HPlayground仍然在0.4上。如果您想使用它,不幸的是,您将不得不回到0.4,直到HPlayground被修补为0.5。
一般来说,如果您是在一个非Linux平台上(而且可能也是在Linux平台上,因为您获得了手册页和其他细节),那么您应该安装预构建二进制文件;构建过程可能很棘手,并且容易出错。
一旦您这样做了,您可以参考hasted-lang.org上的文档和资源页面,其中包含指向API文档、视频教程、源代码示例等的链接。
发布于 2016-03-20 04:34:58
一旦安装了ghc和cabal,您将需要按照如下(来自http://haste-lang.org/downloads/ )的方式安装该快速编译器:
$ cabal update
$ cabal install haste-compiler
$ haste-boot在这样做之后,"hastec“(hastec编译器)应该可以用来将haskell编译成javascript。此外,“匆忙-阴谋”(急迫版本的阴谋)应该可以用来安装库,例如在你的程序中使用。
用于快速栖木(https://github.com/agocorona/haste-perch)的自述文件包含了有关安装快速栖木的说明。这些指令使用“快速-inst”来安装“快速栖息”,但是“快速-inst”已经过时了(并且不再存在)。使用以下修改后的说明安装“快速栖息”:
>git clone http://github.com/agocorona/haste-perch.git
>cd haste-perch
>haste-cabal install我能够安装急救箱,并成功地建立了它附带的例子。
我还尝试构建h游乐场,但遇到了编译问题,这些问题似乎是由于代码未被更新以使用haste0.5。例如,"OnClick“在较早版本的haste中是一个有效的标识符,但不再是:
src/Haste/HPlay/View.hs:820:45:
Not in scope: data constructor ‘OnClick’
Perhaps you meant ‘Click’ (line 1017)https://stackoverflow.com/questions/36109550
复制相似问题