Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

For a new project, is ditching Cabal altogether and using Stack recommended?


For a recent project I did:

    cabal init
    stack init
    stack build
Then I wanted a newer version of persistent, so I opened up my stack.yaml file and added persistent 2.2 to the extra-deps section:

extra-deps: - persistent-2.2

Then I was wondering how to make emacs haskell-mode work with it, and I saw this[0] in the stack repo:

    ((haskell-mode . ((haskell-indent-spaces . 4)
                      (hindent-style . "johan-tibell")
                      (haskell-process-type . ghci)
                      (haskell-process-path-ghci . "stack")
                      (haskell-process-args-ghci . ("ghci")))))
Now everything is working flawlessly and very fast. As a bonus Haskell-mode works correctly for projects I haven't moved to/tested with stack yet.

0: https://github.com/commercialhaskell/stack/blob/master/.dir-...


Same experience here--that .dir-locals.el was absolutely crucial.

In case anyone is wondering how to turn on language pragmas with stack ghci in emacs, I did this for the project I'm working on, because I need OverloadedStrings turned on:

((haskell-mode . ((haskell-indent-spaces . 4) (hindent-style . "johan-tibell") (haskell-process-type . ghci) (haskell-process-path-ghci . "stack") (haskell-process-args-ghci . ("ghci" "--ghc-options" "-XOverloadedStrings")))))


Well, you aren't ditching Cabal-the-spec anytime soon :)

I didn't know about Stack before reading this, but it sounds very good. Cabal-install has always given me problems.

I definitely recommend at least trying it out, and will do so myself.


Not yet if it's a Yesod project, because yesod devel is tightly coupled to cabal-install.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: