Skip to content

feat: add nix, use hspec for tests, extended API, and dual cabal/stack support#14

Merged
rasheedja merged 27 commits intomasterfrom
junaidr/add-hspec
Apr 18, 2026
Merged

feat: add nix, use hspec for tests, extended API, and dual cabal/stack support#14
rasheedja merged 27 commits intomasterfrom
junaidr/add-hspec

Conversation

@rasheedja
Copy link
Copy Markdown
Owner

@rasheedja rasheedja commented Jun 21, 2025

Summary

A comprehensive overhaul covering build tooling, CI, testing, and API.

Build & dev environment

  • Added Nix flake (flake.nix) for a reproducible dev environment via nix develop, pinned to nixos-25.11 with GHC 9.6, cabal, stack, fourmolu, hlint, and HLS
  • Replaced hpack package.yaml with a hand-maintained simplex-method.cabal with updated version bounds (supports GHC 9.2–9.12)
  • Added Makefile with generic targets (make build, make test, make ci, etc.) delegating to cabal or stack via BUILD_TOOL=cabal|stack

CI

  • Haskell CI (haskell.yml): cabal matrix across GHC 9.2, 9.4, 9.6, 9.8, 9.10, 9.12 × ubuntu/macos/windows
  • Stack CI (haskell-stack.yml): Stack LTS 22.44 on ubuntu and macos
  • Nix CI (haskell-nix.yml): parallel cabal and stack jobs inside nix develop, with flake input freshness check

Testing

  • Integrated HSpec with hspec-discover; wrapped existing golden tests in TwoPhaseSpec and UtilSpec with a Spec.hs entry point

API changes

  • Extended VarDomain to support optional upper/lower bounds; updated twoPhaseSimplex to use the new API
  • twoPhaseSimplex now accepts a list of objective functions, allowing users to optimise multiple variables against one constraint set, or pass an empty list to run Phase 1 only

Code quality

  • Explicit import lists on all unqualified imports
  • Removed unused functions
  • Tidied Haddock comments
  • Updated fourmolu to 0.15

@rasheedja rasheedja force-pushed the junaidr/add-hspec branch 3 times, most recently from acb7f01 to a821ddb Compare June 22, 2025 11:34
@rasheedja rasheedja force-pushed the junaidr/add-hspec branch 2 times, most recently from aab454c to b25adaa Compare November 7, 2025 19:47
@rasheedja rasheedja changed the title refactor: add hspec and switch to cabal refactor: add hspec, nix, and switch to cabal Nov 7, 2025
+ Use hspec with the existing golden tests
+ Use cabal instead of stack, and give deps some sensible constraints
+ Use nix flake to get cabal, ghc, etc.
@rasheedja rasheedja force-pushed the junaidr/add-hspec branch from 497d8d6 to 1ec80c3 Compare March 1, 2026 15:10
@rasheedja rasheedja force-pushed the junaidr/add-hspec branch 17 times, most recently from 92529e6 to 529aeff Compare April 4, 2026 12:13
@rasheedja rasheedja force-pushed the junaidr/add-hspec branch from 69462cc to 1a67d9d Compare April 4, 2026 13:13
@rasheedja rasheedja force-pushed the junaidr/add-hspec branch from 1a67d9d to 668f826 Compare April 4, 2026 13:15
@rasheedja rasheedja changed the title refactor: add hspec, nix, and switch to cabal feat: nix dev environment, HSpec testing, extended API, and dual cabal/stack support Apr 18, 2026
@rasheedja rasheedja changed the title feat: nix dev environment, HSpec testing, extended API, and dual cabal/stack support feat: add nix, use hspec for tests, extended API, and dual cabal/stack support Apr 18, 2026
@rasheedja rasheedja merged commit 4f88c75 into master Apr 18, 2026
23 checks passed
@rasheedja rasheedja deleted the junaidr/add-hspec branch April 18, 2026 12:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant