Skip to content

voidus/haskell-project-skeleton

Repository files navigation

Haskell-Project-Skeleton

This is an opinionated haskell project starter. I plan to update it when my preferences for tooling/configuration and my comfort with heavier tooling evolves. I mostly use this for experiments, so it might lack things that are important for you.

I found myself rewriting this a few times, so I thought I'd bundle it up. Feel free to use however you see fit.

Feedback and suggestions are always appreciated.

How to use

I suggest cloning and throwing away the history:

PROJECT_NAME=<your project name goes here>
git clone --depth=1 https://github.com/voidus/haskell-project-skeleton.git ${PROJECT_NAME}
cd $PROJECT_NAME && rm -rf .git
git init . && git add . && git commit -m'Initial commit"

If you are using this for a serious project, you might also want to pin the nixpkgs version by replacing pkgs = import <nixpkgs> {}; in shell.nix with

pkgs = import (builtins.fetchTarball {
  # Descriptive name to make the store path easier to identify
  name = "nixos-unstable-2018-09-12";
  # Commit hash for nixos-unstable as of 2018-09-12
  url = "https://github.com/nixos/nixpkgs/archive/ca2ba44cab47767c8127d1c8633e2b581644eb8f.tar.gz";
  # Hash obtained using `nix-prefetch-url --unpack <url>`
  sha256 = "1jg7g6cfpw8qvma0y19kwyp549k1qyf11a5sg6hvn6awvmkny47v";
}) {}

What's included

  • Dev environment
    • direnv to automatically load dev tools
    • nix to deterministally manage dev environments
  • Compilation tools
  • Libraries and stuff
  • Developer tools
    • ghcid for rapid feedback
      • It's set up with --reverse-errors, so it shows the first error last. This takes a little getting used to, but it avoids having to scroll up in the terminal running ghcid.
    • hlint to get hints on how to improve the code
    • ormolu for automatic formatting

Similar projects

About

An opinionated haskell project starter

Resources

License

Stars

Watchers

Forks

Packages

No packages published