How to install a package using stack?

Using cabal, I could install hakyll with the command:

cabal install hakyll

How can I do the same thing using stack?


stack install hakyll

stack offers a curated set of packages that won't blow your machine up. If you want to check what packages are available, or exactly what version is supported, or on what version of GHC you can get it, check out

For example, you can get hakyll right now for both GHC 7.8.4 and GHC 7.10.1. Pretty neat. - source

EDIT: I forgot to mention, Yuan Wang's method works for getting the version of hakyll that is not curated into stackage. It's up to you what version you need.

add hakyll in stack.yaml generated by stack init or stack new

yaml file should look like:

flags: {}
  - '.'
  - hakyll-
resolver: lts-2.15

after that, run stack solver installs it

Need Your Help

Getting "Cannot open include file: 'atlbase.h': No such file or directory" error

c++ visual-studio-2013 atl include-path

I am swapping machines (between two Windows 8.1 laptops) and have just loaded the project I'm working on from TFS. On one machine it compiles, on the other it does not and gives the first error

No Idea why : The ResourceConfig instance does not contain any root resource classes

java rest jersey

I'm new to jersey and web services and I'm try to run a simple RESTful web service. I followed but my project doesn't use maven ...