How to iterate in a snap without installing cabal

I like snap snap, but I hate running “cabal install” with every iteration (slight code change). I want to try.

Is there an alternative for fast iteration?

+4
source share
2 answers

Start with

cabal install --reinstall -fhint snap 

Then for your project:

 cabal clean cabal configure -fdevelopment cabal build ./dist/build/projname/projname 

You should never use cabal install for binary files that you do not want to run from arbitrary locations. You should use cabal build for things that you want to use only locally.

You will need to run cabal build and run the program again when changing Main.hs or the project .cabal file.

If you have additional questions, comment - I'm the guy who implemented this feature for Binding.

+9
source

Yesod provides a yesod devel that automatically reloads code changes. I don't know about comparable capabilities in a snap, but it is very likely that they can reuse most of the Yesod code that does this.

Given the existence of Snap.Loader.Devel, I assume that they can already provide something like what you are asking for, but I can’t Find the documentation on how to use it. Question with answers How do I run the application in development mode , cabal install is still required; it’s not clear from the documents whether this needs to be done only once or every time the code changes.

+2
source

Source: https://habr.com/ru/post/1403117/


All Articles