02: Haskell Tools


  • stack looks to be the sort of NPM of haskell
  • reproduceable builds,
  • YAML file config. cabal config too

Command Line

  • stack build and then stack exec hello-world-exe

  • the build will create an executable in the ./stack-work and look there for executables. cool

  • The Setup.hs file is a component of the Cabal build system which stack uses. It’s technically not needed by stack, but it is still considered good practice in the Haskell world to include it. The file we’re using is straight boilerplate:

  • Ok so cabal is a build system that stack uses, but good practice.

  • It is also important to remember that stack is built on top of the Cabal build system. Therefore, an understanding of the moving parts in Cabal are necessary. In Cabal, we have individual packages, each of which contains a single .cabal file. The .cabal file can define 1 or more components: a library, executables, test suites, and benchmarks. It also specifies additional information such as library dependencies, default language pragmas, and so on.

  • So it looks like cabal is the actual package builder and stack is a sort of management tool for haskell language, cabal, and all the other bits/pieces

  • Which ghc is it using?

  • jtomchak@MeowBook:/c/Users/jtomc/Documents/Haskell/hello-world$ stack exec -- which ghc /home/jtomchak/.stack/programs/x86_64-linux/ghc-8.4.3/bin/ghc

Macros ?

  • {-# LANGUAGE OverloadedStrings #-}
  • not sure what the line means ?
  • appears to be some sort of compile macro ?


* [Install](https://docs.haskellstack.org/en/stable/install_and_upgrade/)