This should work, but take that with a grain of salt as I'm having extra issues due to this known bug. Make sure your .cabal
file has the right dependencies, especially the if impl(haste) ..
part (see this). Seems like most of the dependencies for Haste (and since Haste uses GHC 7.10.3 as of today) work with lts-6.14
, so I used that as resolver.
haste-project.cabal
name: haste-project
version: 0.1.0.0
category: Web
build-type: Simple
cabal-version: >=1.10
executable haste-project-exe
hs-source-dirs: app
main-is: Main.hs
build-depends: base >= 4.8 && < 4.9
if impl(haste)
build-depends: haste-lib >= 0.5 && < 0.6
else
build-depends: haste-compiler >= 0.5 && < 0.6
default-language: Haskell2010
stack.yaml
extra-deps:
- HTTP-4000.2.23
- ghc-simple-0.3
- haste-compiler-0.5.4.2
- shellmate-0.2.3
resolver: lts-6.14
Then, from the same directory, you can now proceed with the usual setup instructions for Haste, but with Stack complements of the Cabal commands:
$ stack build
$ stack install haste-compiler # installs haste-boot, haste-cat, haste-pkg, and hastec
$ stack exec haste-boot # setup Haste (where I get the bug I mentioned above)
Then, you should be able to run all the usual commands, but prefixed with stack exec --
. For example
$ stack exec -- hastec -O2 -fglasgow-exts myprog.hs