Haskell Stack install package dependency from github

For stack <1.11: The documentation for the stack.yaml packages section gives examples of referring to more complex package locations. packages: – location: . – location: dir1/dir2 – location: https://example.com/foo/bar/baz-0.0.2.tar.gz – location: http://github.com/yesodweb/wai/archive/2f8a8e1b771829f4a8a77c0111352ce45a14c30f.zip – location: git: git@github.com:commercialhaskell/stack.git commit: 6a86ee32e5b869a877151f74064572225e1a0398 – location: hg: https://example.com/hg/repo commit: da39a3ee5e6b4b0d3255bfef95601890afd80709 Then add extra-dep: true to the package entry just to tell … Read more

Generating documentation for my own code with Haddock and stack

According to this ticket on the stack issue tracker, Stack can currently only build documentation for libraries, but not executables. Cabal can be configured to work with the stack databases with this command: cabal configure –package-db=clear –package-db=global –package-db=$(stack path –snapshot-pkg-db) –package-db=$(stack path –local-pkg-db) after which you can run cabal haddock –executables to generate the documentation. … Read more

How to use a DLL in a Haskell project?

You’ll need to use extra-lib-dirs and extra-libraries in the executable section of your .cabal file like so: name: MyApp version: 0.1.0.0 synopsis: homepage: author: simon.bourne category: build-type: Simple cabal-version: >=1.10 library exposed-modules: HelloWorld build-depends: base >= 4.7 && < 5 hs-source-dirs: src default-language: Haskell2010 executable MyApp main-is: Main.hs extra-lib-dirs: lib extra-libraries: helloWorld build-depends: base >= … Read more

How to install a package 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 https://www.stackage.org/. For example, you can get hakyll 4.6.9.0 right now for both … Read more

Profiling builds with Stack

Profiling builds with Stack 1.0.0 and newer To build with profiling enabled: stack build –profile You may need to run stack clean first, but this should be fixed in Stack 1.5.0. To profile: stack exec –profile — <your program> +RTS <profiling options> where for <profiling options> you might want -p for time profiling or -h … Read more