Skip to content

pascalpoizat/template-haskell-project

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

95 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

template-haskell-project

Build Status License Version

A simple template for Haskell projects built with Stack, together with some basic information to get into Haskell.

Some complementary language-independent information can be found here (one may have to dig among Java-specific stuff).

Note: version in the source code, the Cabal configuration, and the CI workflow (this should be automated).

Installing the environment

The environment is made up of the GHC compiler and a dependency manager / build tool such as Cabal or Stack. Haskell libraries can be found on Hackage. Stack comes with sets of compatible libraries from Hackage organized in Long Term Support releases(LTS).

Versions we use (at the time of writing):

GHC Cabal Stack LTS
9.2.5 3.6.2 2.9.1 20.5

Installing the environment is simplified using GHCup.

  1. install GHCup as presented here
  2. install GHC, Cabal and/or Stack using GHCup as presented here.

This project requires installing both Cabal and Stack.

IDE

A simple (and feature-rich) solution is to use the Haskell Language Server (HLS) which can be installed using GHCup as presented here, and have your IDE work with it.

For Visual Studio Code you can use the Haskell plugin, which is able to download HLS by need for you (indeed, it uses GHCUp for this).

But HLS works with many more IDEs.

Tools

  • summoner, to setup Haskell projects (can avoid a lot of burden when starting a new project)
  • hlint and stan, to analyse your code and/or propose refactoring

Libraries

Archives

Personal selection

  • specific preludes
    • relude, lightweight standard library
  • data structures
  • parsing:
  • file formats:
    • aeson, for JSON parsing/encoding
    • xml, for simple XML-related tasks, and HaXml, for more complex ones
    • cassava, for CSV parsing/encoding