| Start |
|---|
| Profiling with Stack Configure profiling for a project via GHC flags are not required in the cabal file for this to work (like |
Structure File structureA simple project has the following files included in it: In the folder Main.hs Running the programMake sure you are in the directory |
| Build and Run a Stack Project In this example our project name is "helloworld" which was created with First we have to build the project with |
| Viewing dependencies To find out what packages your project directly depends on, you can simply use this command: This way you can find out what version of your dependencies where actually pulled down by stack. Haskell projects frequently find themselves pulling in a lot of libraries indirectly, and sometimes these external dependencies cause problems that you need to track down. If you find yourself with a rogue external dependency that you'd like to identify, you can grep through the entire dependency graph and identify which of your dependencies is ultimately pulling in the undesired package:
You can also set the depth of the dependency graph if you want: |
| Installing Stack Mac OSX Using Homebrew (opens new window): |
| Creating a simple project To create a project called helloworld run: This will create a directory called |
| Stack install By running the command Stack will copy a executable file to the folder |
| Stackage Packages and changing the LTS (resolver) version Stackage (opens new window) is a repository for Haskell packages. We can add these packages to a stack project. Adding lens to a project.In a stack project, there is a file called Stackage keeps a list of packages for every revision of Looking through the packages, there is a Lens-4.13 (opens new window). We can now add the language package by modifying the section of to: Obviously, if we want to change a newer LTS (after it's released), we just change the resolver number, eg.: With the next |
Read Article
https://develop.horje.com/learn/1434/reference