Some random programming problems in Haskell. All code is in the test
directory.
This project will hopefully serve as a useful reference to anyone interested in trying out programming problems using Haskell with continuous test feedback.
Nix is recommended to get up and running.
Assuming Nix is installed, run bin/test
, all tests will run and will rerun each time a file changes.
To start a new kata, add a new file to the test
directory (the file name must end with Spec.hs
), also add the file name to the end of haskell-katas.cabal
.
Hspec is used for testing, so a spec
function will be needed.
Here is a scaffold for a new file:
module WibbleSpec where
import Test.Hspec
spec :: Spec
spec = describe "Testy time" $ do
it "should work" $ do
pending
To have unit tests run automatically upon file save with ghcid, run the following in a terminal:
bin/test
On first run, the ghc compiler and project dependencies will be installed into the nix store (subsequent runs will use the binaries in your local nix store).
Instructions for Linux and macOS