Skip to content

jappeace/haskell-template-project

Repository files navigation

https://jappieklooster.nl Github actions build status Jappiejappie Hackage version

The eye that looks ahead to the safe course is closed forever.

Haskell project template.

Set up cabal within a nix shell. If you like nix this is a good way of doing haskell development.

similar to: https://github.com/monadfix/nix-cabal except this has a makefile and ghcid. We also make aggressive use of pinning ensuring project builds for ever (theoretically).

Comes with:

  • GHCID
  • a nix shell, meaning somewhat platform independence.
    • which is pinned by default
  • A couple of handy make commands.
  • Starting haskell files, assuming we put practically all code in library
  • Working test suite.
  • functioining CI (pick your favorite or keep both)
    • for various platforms with cabal
    • a nix flake.

Usage

Modifying for your project

Assuming the name of your new project is new-project.

git clone git@github.com:jappeace/haskell-template-project.git new-project
cd new-project
  • Edit template.cabal,
    • find and replace template with new-project
    • Update copyright
    • Update github
  • rename template.cabal to new-project.cabal
  • Edit Changelog.md
    • replace template with new-project
    • Also describe your version 1.0.0 release.
  • Edit flake.nix, replace template with new-project.
  • Edit copyright in LICENSE
  • For automatic bound bumping: In “Settings” → “Actions” → “General” → “Workflow permissions” tick “Allow GitHub Actions to create and approve pull requests”

Reconfigure remotes

git remote add template git@github.com:jappeace/haskell-template-project.git
git remote set-url origin git@github.com:YOUR-ORG-OR-USER-NAME/new-project.git

We can get template updates like this if we want to by doing git pull template. There will be a large amount of conflicts, but the merge commit should solve them permanently.

Readme

  • Select desired badges.
    • Point build badges to right project
  • Give short project description.
  • Add new quote suited for the project. For example for fakedata-quickcheck I used Kant because he dealt with the question "what is truth" a lot.
  • Truncate this checklist
  • Truncate motivation for using this template

Tools

Enter the nix shell.

nix develop

You can checkout the makefile to see what's available:

cat makefile

Running

make run

Fast filewatch which runs tests

make ghcid

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published