如何使用堆栈的haste/hplayground

Kev*_*orn 6 haskell haste

我对Haskell(语言)有一定的了解,但对工具链却没那么熟悉.(在cabal和堆栈存在之前,我在Haskell中玩过.)我被告知堆栈是我应该用来管理Haskell项目的工具.我正在尝试学习匆忙的库,我在第一个我尝试过的教程上遇到了困难,因为我无法安装hplayground.我创建了一个堆栈项目; 我的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
Run Code Online (Sandbox Code Playgroud)

我的.cabal文件在build-depends中列出了hplayground.但是当我运行堆栈构建时,我得到以下错误:

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)
Run Code Online (Sandbox Code Playgroud)

还有很多类似的错误.对我做错了什么的想法?

更广泛地说:对于没有Haskell工具链经验的人来说,快速,简单地快速启动和运行的方法是什么?

val*_*man 3

Haste 的事件 API 在 0.4 和 0.5 系列之间进行了彻底修改,而 HPlayground 仍在 0.4 上。如果你想使用它,不幸的是你必须回退到 0.4,直到 HPlayground 被修补为 0.5。

一般来说,如果您使用的是非 Linux 平台,那么您应该安装预构建的二进制文件(如果您也使用的是 Linux 平台,因为您可以获得手册页和其他细节);构建过程可能很棘手并且容易出错。

完成此操作后,您可以参考haste-lang.org 上的文档和资源页面,其中包含 API 文档、视频教程、源代码示例等的链接。