How to use acceleration / hplayground with glass

I have some familiarity with the Haskell language, but not so much with the toolchain. (I played with Haskell before the bondage and the stack were found.) I was told that the stack is a tool that I should use to manage Haskell projects. I am trying to learn the speed library and I got stuck in the first tutorial that I tried because I cannot install hplayground. I created a stack project; my stack.yaml has

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 

and my .cabal file has an hplayground specified based on the build. But when I start the stack build, I get the following errors:

 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) 

and many similar errors. Any thoughts on what I'm doing wrong?

In a broader sense: what is a quick and easy way to speed up and speed up work for those who have not encountered the Haskell toolchain?

+6
source share
2 answers

Acceleration event APIs have been redesigned between the 0.4 and 0.5 series, and the HPlayground is still 0.4. If you want to use it, you will unfortunately have to go back to 0.4 until HPlayground receives a patch for 0.5.

To get started, you must install the preliminary builds of the binary files if you are on a platform other than Linux (and, possibly, if you are also on the Linux platform, since you get man pages and other subtleties); The build process can be complex and error prone.

Once you have done this, you can go to the docs and resources page at haste-lang.org, which contains links to the docs API, video tutorials, source code examples, etc.

+2
source

After you have installed ghc and cabal, you will need to install the haste compiler as follows (from http://haste-lang.org/downloads/ ):

 $ cabal update $ cabal install haste-compiler $ haste-boot 

After that, "hastec" (acceleration compiler) should be available for haskell compilation in javascript. In addition, "haste-cabal" (a high-speed version of cabal) should be available for installation to install libraries, such as acceleration, for use in your programs.

The readme file for haste-perch ( https://github.com/agocorona/haste-perch ) contains instructions for setting the acceleration. These instructions use haste-inst to set the rush, but haste-inst is deprecated (and no longer exists). Use the instructions below to set the acceleration:

 >git clone http://github.com/agocorona/haste-perch.git >cd haste-perch >haste-cabal install 

I was able to install haste-perch and successfully build the example with which it came.

I also tried to build hplayground, but ran into compilation problems that looked like they were due to code not being updated to use 0.5 acceleration. For example, "OnClick" was a valid identifier in earlier versions of the rush, but no more:

 src/Haste/HPlay/View.hs:820:45: Not in scope: data constructor 'OnClick' Perhaps you meant 'Click' (line 1017) 
+3
source

All Articles