Collections of project templates for the stack Haskell build tool.
Templates are written in hsfiles format, using mustache.
To create a new project based on one of these templates run
stack <options> new <project-name> alessandrocandolini/<name of the corresponding hsfile>
assuming stack is installed in the system. Here, <options>
is any command-line option available for stack, <project-name>
is the name of the project that will be created and <name of the corresponding hsfile>
is the name of a hsfile
in this repo. For example,
stack new hello-world alessandrocandolini/cli-template
or
stack --resolver nightly-2020-12-12 new hello-world alessandrocandolini/cli-template
Refer to Stack templates documentation for more information on how to provide and use templates, and to the official stack documentation for a comprehensive list of available options when running stack.
Generates a simple CLI application, with command-line arguments parsed using optparse-applicative. Tests are written in hspec, using hspec-discovery. A number of additional general-purpose common libraries are imported by default (eg, aison, neat-quasi-quote, etc)
Generates a simple servant server running on wai. The server includes only an healthcheck endpoint GET /status
returning a pre-hardcoded 200 {"status":"ok"}
response. The project generates also a simple test to verify the implementation of the healthcheck endpoint.
There is a variant of cli-template
that generates a project for Advent of Code. However this template is not as maintained as the other ones, and we don't run CI tests to save time.