From 2889b26fb02e65973575b0cfdfc5b89769929b3d Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Mon, 17 Jun 2024 02:31:22 +0000 Subject: [PATCH 1/6] Lock file maintenance --- flake.lock | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/flake.lock b/flake.lock index 06e3db2..af237bd 100644 --- a/flake.lock +++ b/flake.lock @@ -135,11 +135,11 @@ "project-manager": "project-manager" }, "locked": { - "lastModified": 1710380653, - "narHash": "sha256-WD38tdZ6JX6+tftIamWnMlfb/jZ9J1j8MicTEBN9iuo=", + "lastModified": 1714201379, + "narHash": "sha256-T0Jc6s2ObViZtB2p6GEknpXbUDKrslaUz7HTgUE4hgc=", "owner": "sellout", "repo": "flaky", - "rev": "ce9a4ba6741fdbfd9944f13e4a326fd467fe94fd", + "rev": "3f1b2a419ef7ff0ca778e25cb74eb98897d07c6f", "type": "github" }, "original": { @@ -241,11 +241,11 @@ }, "nixpkgs": { "locked": { - "lastModified": 1710373328, - "narHash": "sha256-84TeOyBo8HG/Qie8V3aojtqMC5Uc4loY5KIOxO0f6xk=", + "lastModified": 1718548739, + "narHash": "sha256-SCKSTpxrFG/z0ymKcGgZk5Z2sBARNlJzmG/JI7v8ntg=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "446d09bfe74f1c893917a67baee88d978316fbc9", + "rev": "eb04fca4de8d2f6e170a7ff3279ca47a37cced1c", "type": "github" }, "original": { From dd2efba88b7405ba0c947f2213bd1466f29443bf Mon Sep 17 00:00:00 2001 From: Greg Pfeil Date: Fri, 23 Aug 2024 22:38:27 -0600 Subject: [PATCH 2/6] Sync Flaky template --- .cache/vale/Vocab/haskerwaul/accept.txt | 25 ++ .../config/vocabularies/haskerwaul/accept.txt | 25 ++ .config/mustache.yaml | 4 +- .config/project/default.nix | 105 +++++-- .config/project/github-ci.nix | 109 ++++++- .config/project/hackage-publish.nix | 15 +- .github/renovate.json | 2 +- .github/settings.yml | 2 +- .github/workflows/build.yml | 2 +- .github/workflows/hackage-publish.yml | 2 +- README.md | 253 +++------------ base/CHANGELOG.md | 12 + base/README.md | 98 ++++++ base/Setup.hs | 5 + base/docs/license-report.md | 40 +++ base/haskerwaul-base.cabal | 37 ++- flake.lock | 277 +++++----------- flake.nix | 213 +++++-------- garnix.yaml | 2 +- haskerwaul/CHANGELOG.md | 12 + haskerwaul/README.md | 297 ++++++++++++++++++ haskerwaul/Setup.hs | 5 + haskerwaul/docs/license-report.md | 39 +++ haskerwaul/haskerwaul.cabal | 39 ++- hedgehog/CHANGELOG.md | 12 + hedgehog/README.md | 94 ++++++ hedgehog/Setup.hs | 5 + hedgehog/docs/license-report.md | 73 +++++ hedgehog/haskerwaul-hedgehog.cabal | 37 ++- trample/CHANGELOG.md | 12 + trample/README.md | 94 ++++++ trample/Setup.hs | 5 + trample/docs/license-report.md | 41 +++ trample/haskerwaul-trample.cabal | 37 ++- 34 files changed, 1387 insertions(+), 643 deletions(-) create mode 100644 base/CHANGELOG.md create mode 100644 base/README.md create mode 100644 base/docs/license-report.md create mode 100644 haskerwaul/CHANGELOG.md create mode 100644 haskerwaul/README.md create mode 100644 haskerwaul/docs/license-report.md create mode 100644 hedgehog/CHANGELOG.md create mode 100644 hedgehog/README.md create mode 100644 hedgehog/docs/license-report.md create mode 100644 trample/CHANGELOG.md create mode 100644 trample/README.md create mode 100644 trample/docs/license-report.md diff --git a/.cache/vale/Vocab/haskerwaul/accept.txt b/.cache/vale/Vocab/haskerwaul/accept.txt index f6a4ec5..7233a9d 100644 --- a/.cache/vale/Vocab/haskerwaul/accept.txt +++ b/.cache/vale/Vocab/haskerwaul/accept.txt @@ -3,10 +3,35 @@ garnix [Nn]ix Pfeil ShellCheck +API +Bool bugfix +categorification +categorified comonad +concat conditionalize +coproduct +dev +enrichment +exponential +formatter functor GADT +Hask +Haskerwaul +Hom Kleisli Kmett +monoidal +morphism +newtype +nLab +oidification +overconstrained +pragma +preorder +README +topos +unformatted +widening diff --git a/.cache/vale/config/vocabularies/haskerwaul/accept.txt b/.cache/vale/config/vocabularies/haskerwaul/accept.txt index f6a4ec5..7233a9d 100644 --- a/.cache/vale/config/vocabularies/haskerwaul/accept.txt +++ b/.cache/vale/config/vocabularies/haskerwaul/accept.txt @@ -3,10 +3,35 @@ garnix [Nn]ix Pfeil ShellCheck +API +Bool bugfix +categorification +categorified comonad +concat conditionalize +coproduct +dev +enrichment +exponential +formatter functor GADT +Hask +Haskerwaul +Hom Kleisli Kmett +monoidal +morphism +newtype +nLab +oidification +overconstrained +pragma +preorder +README +topos +unformatted +widening diff --git a/.config/mustache.yaml b/.config/mustache.yaml index 069d6ef..fba6826 100644 --- a/.config/mustache.yaml +++ b/.config/mustache.yaml @@ -3,6 +3,6 @@ "name":"haskerwaul", "repo":"sellout/haskerwaul", "summary":"Category-parametric programming", - "version":"0.1.0.0"}, + }, "type":{"name":"haskell"} - } +} diff --git a/.config/project/default.nix b/.config/project/default.nix index a7648a1..7fb3f5a 100644 --- a/.config/project/default.nix +++ b/.config/project/default.nix @@ -7,7 +7,12 @@ supportedSystems, ... }: let - githubSystems = ["macos-13" "ubuntu-22.04" "windows-2022"]; + githubSystems = [ + "macos-13" # x86_64-darwin + "macos-14" # aarch64-darwin + "ubuntu-22.04" # x86_64-linux + "windows-2022" + ]; in { project = { name = "haskerwaul"; @@ -16,11 +21,32 @@ in { devPackages = [ pkgs.cabal-install pkgs.graphviz + ## So cabal-plan(-bounds) can be built in a devShell, since it doesn’t + ## work in Nix proper. + pkgs.zlib ]; }; imports = [ - (import ./github-ci.nix githubSystems) + (import ./github-ci.nix { + inherit (self.lib) defaultGhcVersion; + exclude = [ + ## FIXME: There seems to be a general issue with this GHC version and + ## aarch64-darwin. + { + ghc = "9.4.1"; + os = "macos-14"; + } + ]; + latestGhcVersion = "9.10.1"; + packages = { + haskerwaul = "haskerwaul"; + haskerwaul-base = "base"; + haskerwaul-hedgehog = "hedgehog"; + haskerwaul-trample = "trample"; + }; + systems = githubSystems; + }) ./hackage-publish.nix ./hlint.nix ]; @@ -51,23 +77,51 @@ in { enable = true; ## Haskell formatter programs.ormolu.enable = true; + settings.formatter.prettier.excludes = ["*/docs/license-report.md"]; }; vale = { enable = true; excludes = [ "*.cabal" "*.hs" + "*.hs-boot" "*.lhs" + "*/docs/license-report.md" "./cabal.project" ]; vocab.${config.project.name}.accept = [ + "API" + "Bool" "bugfix" + "categorification" + "categorified" "comonad" + "concat" "conditionalize" + "coproduct" + "dev" + "enrichment" + "exponential" + "formatter" "functor" "GADT" + "Hask" + "Haskerwaul" + "Hom" "Kleisli" "Kmett" + "monoidal" + "morphism" + "newtype" + "nLab" + "oidification" + "overconstrained" + "pragma" + "preorder" + "README" + "topos" + "unformatted" + "widening" ]; }; }; @@ -76,30 +130,27 @@ in { services.garnix = { enable = true; builds = { - exclude = [ - # TODO: Remove once garnix-io/garnix#285 is fixed. - "homeConfigurations.x86_64-darwin-${config.project.name}-example" - ]; + ## TODO: Remove once garnix-io/garnix#285 is fixed. + exclude = ["homeConfigurations.x86_64-darwin-example"]; include = lib.mkForce ( [ "homeConfigurations.*" "nixosConfigurations.*" ] - ++ lib.concatLists ( - flaky.lib.garnixChecks - ( - sys: - [ - "checks.${sys}.*" - "devShells.${sys}.default" - "packages.${sys}.default" - ] - ++ lib.concatMap (ghc: [ - "devShells.${sys}.${ghc}" - "packages.${sys}.${ghc}_all" - ]) - (self.lib.testedGhcVersions sys) - ) + ++ flaky.lib.forGarnixSystems supportedSystems ( + sys: + [ + "checks.${sys}.*" + "devShells.${sys}.default" + "packages.${sys}.default" + ] + ++ lib.concatMap (version: let + ghc = self.lib.nixifyGhcVersion version; + in [ + "devShells.${sys}.${ghc}" + "packages.${sys}.${ghc}_all" + ]) + (self.lib.testedGhcVersions sys) ) ); }; @@ -108,7 +159,8 @@ in { ## Need to improve module merging. services.github.settings.branches.main.protection.required_status_checks.contexts = lib.mkForce - (lib.concatMap (sys: + (["check-bounds"] + ++ lib.concatMap (sys: lib.concatMap (ghc: [ "build (${ghc}, ${sys})" "build (--prefer-oldest, ${ghc}, ${sys})" @@ -116,9 +168,11 @@ in { self.lib.nonNixTestedGhcVersions) githubSystems ++ flaky.lib.forGarnixSystems supportedSystems (sys: - lib.concatMap (ghc: [ - "devShell ghc${ghc} [${sys}]" - "package ghc${sys}_all [${sys}]" + lib.concatMap (version: let + ghc = self.lib.nixifyGhcVersion version; + in [ + "devShell ${ghc} [${sys}]" + "package ${ghc}_all [${sys}]" ]) (self.lib.testedGhcVersions sys) ++ [ @@ -136,4 +190,5 @@ in { # this is disabled until we have a way to build Haskell without IFD. services.flakehub.enable = false; services.github.enable = true; + services.github.settings.repository.topics = ["category-theory"]; } diff --git a/.config/project/github-ci.nix b/.config/project/github-ci.nix index 6f35060..2dd2169 100644 --- a/.config/project/github-ci.nix +++ b/.config/project/github-ci.nix @@ -1,10 +1,21 @@ -githubSystems: { +## TODO: Map `systems` and `exclude` from Nixier values – perhaps flake-utils +## systems, and a bool for `--prefer-oldest`? +{ + systems, + packages, + ## TODO: Prefer ignoring most known failures once + ## https://github.com/orgs/community/discussions/15452 is resolved. + exclude ? [], + defaultGhcVersion, + latestGhcVersion, +}: { lib, pkgs, self, ... }: let - planName = "plan-\${{ runner.os }}-\${{ matrix.ghc }}\${{ matrix.bounds }}"; + planName = "plan-\${{ matrix.os }}-\${{ matrix.ghc }}\${{ matrix.bounds }}"; + runs-on = "ubuntu-22.04"; in { services.github.workflow."build.yml".text = lib.generators.toYAML {} { name = "CI"; @@ -20,9 +31,24 @@ in { strategy = { fail-fast = false; matrix = { - ghc = self.lib.nonNixTestedGhcVersions; - os = githubSystems; bounds = ["--prefer-oldest" ""]; + ghc = self.lib.nonNixTestedGhcVersions; + os = systems; + exclude = + [ + ## GHCup can’t find this version for Linux. + { + ghc = "7.10.3"; + os = "ubuntu-22.04"; + } + ] + ## GitHub can’t install GHC older than 9.4 on macos-14. + ++ map (ghc: { + inherit ghc; + os = "macos-14"; + }) (builtins.filter (ghc: lib.versionOlder ghc "9.4") + self.lib.nonNixTestedGhcVersions) + ++ exclude; }; }; runs-on = "\${{ matrix.os }}"; @@ -30,12 +56,11 @@ in { steps = [ {uses = "actions/checkout@v4";} { - ## TODO: Uses deprecated Node.js, see haskell-actions/setup#72 uses = "haskell-actions/setup@v2"; id = "setup-haskell-cabal"; "with" = { - ghc-version = "\${{ matrix.ghc }}"; cabal-version = pkgs.cabal-install.version; + ghc-version = "\${{ matrix.ghc }}"; }; } {run = "cabal v2-freeze $CONFIG";} @@ -46,7 +71,7 @@ in { ''${{ steps.setup-haskell-cabal.outputs.cabal-store }} dist-newstyle ''; - key = "\${{ runner.os }}-\${{ matrix.ghc }}-\${{ hashFiles('cabal.project.freeze') }}"; + key = "\${{ matrix.os }}-\${{ matrix.ghc }}-\${{ hashFiles('cabal.project.freeze') }}"; }; } ## NB: The `doctests` suites don’t seem to get built without @@ -65,18 +90,19 @@ in { ]; }; check-bounds = { - runs-on = "ubuntu-22.04"; + inherit runs-on; + ## Some "build" jobs are a bit flaky. This can give us useful bounds + ## information even without all of the build plans. + "if" = "always()"; needs = ["build"]; steps = [ {uses = "actions/checkout@v4";} { - ## TODO: Uses deprecated Node.js, see haskell-actions/setup#72 uses = "haskell-actions/setup@v2"; id = "setup-haskell-cabal"; "with" = { - ## NB: `cabal-plan-bounds` doesn’t yet support GHC 9.8. - ghc-version = "9.6.3"; cabal-version = pkgs.cabal-install.version; + ghc-version = defaultGhcVersion; }; } {run = "cabal install cabal-plan-bounds";} @@ -98,9 +124,16 @@ in { ## TODO: Simplify this once cabal-plan-bounds supports a `--check` ## option. run = '' - diffs="$(find . \ - -name '*.cabal' \ - -exec cabal-plan-bounds --dry-run plans/*.json --cabal {} \;)" + diffs="$(find . -name '*.cabal' -exec \ + cabal-plan-bounds \ + --dry-run \ + ${ + lib.concatMapStrings + (pkg: "--also " + pkg + " ") + self.lib.extraDependencyVersions or [] + } \ + plans/*.json \ + --cabal {} \;)" if [[ -n "$diffs" ]]; then echo "$diffs" exit 1 @@ -109,6 +142,54 @@ in { } ]; }; + check-licenses = { + inherit runs-on; + ## Some "build" jobs are a bit flaky. Since this only uses one of the + ## jobs from the matrix, we run it regardless of build failures. + "if" = "always()"; + needs = ["build"]; + steps = [ + {uses = "actions/checkout@v4";} + { + uses = "haskell-actions/setup@v2"; + id = "setup-haskell-cabal"; + "with" = { + cabal-version = pkgs.cabal-install.version; + ghc-version = defaultGhcVersion; + }; + } + {run = "cabal install cabal-plan -flicense-report";} + { + name = "download Cabal plans"; + uses = "actions/download-artifact@v4"; + "with" = { + path = "plans"; + pattern = "plan-*"; + merge-multiple = true; + }; + } + { + run = '' + mkdir -p dist-newstyle/cache + mv plans/plan-${runs-on}-${latestGhcVersion}.json dist-newstyle/cache/plan.json + ''; + } + { + name = "check if licenses have changed"; + run = '' + ${lib.toShellVar "packages" packages} + for package in "''${!packages[@]}"; do + { + echo "**NB**: This captures the licenses associated with a particular set of dependency versions. If your own build solves differently, it’s possible that the licenses may have changed, or even that the set of dependencies itself is different. Please make sure you run [\`cabal-plan license-report\`](https://hackage.haskell.org/package/cabal-plan) on your own components rather than assuming this is authoritative." + echo + cabal-plan license-report "$package:lib:$package" + } >"''${packages[$package]}/docs/license-report.md" + done + git diff --exit-code */docs/license-report.md + ''; + } + ]; + }; }; }; } diff --git a/.config/project/hackage-publish.nix b/.config/project/hackage-publish.nix index 1311ec6..e62afa1 100644 --- a/.config/project/hackage-publish.nix +++ b/.config/project/hackage-publish.nix @@ -3,7 +3,9 @@ pkgs, self, ... -}: { +}: let + packagesPath = "\$/packages/"; +in { services.github.workflow."hackage-publish.yml".text = lib.generators.toYAML {} { name = "Publish release to Hackage"; on = { @@ -25,11 +27,20 @@ uses = "actions/checkout@v4"; "with".ref = "\${{ (inputs.tag != null) && format('refs/tags/{0}', inputs.tag) || '' }}"; } + { + uses = "haskell-actions/setup@v2"; + id = "setup-haskell-cabal"; + "with" = { + ghc-version = lib.last self.lib.nonNixTestedGhcVersions; + cabal-version = pkgs.cabal-install.version; + }; + } + {run = "cabal v2-sdist --output-directory='${packagesPath}' all";} { uses = "haskell-actions/hackage-publish@v1"; "with" = { + inherit packagesPath; hackageToken = "\${{ secrets.HACKAGE_AUTH_TOKEN }}"; - packagesPath = "\${{ runner.temp }}/packages"; publish = false; }; } diff --git a/.github/renovate.json b/.github/renovate.json index 0ff5254..6c7953d 100644 --- a/.github/renovate.json +++ b/.github/renovate.json @@ -1 +1 @@ -{"$schema":"https://docs.renovatebot.com/renovate-schema.json","extends":["config:base"],"lockFileMaintenance":{"enabled":true},"nix":{"enabled":true}} \ No newline at end of file +{"$schema":"https://docs.renovatebot.com/renovate-schema.json","extends":["config:base"],"lockFileMaintenance":{"automerge":true,"enabled":true},"nix":{"enabled":true},"packageRules":[{"automerge":true,"matchCurrentVersion":"!/^0/","matchUpdateTypes":["minor","patch"]}]} \ No newline at end of file diff --git a/.github/settings.yml b/.github/settings.yml index 41ec3a1..2f6a267 100644 --- a/.github/settings.yml +++ b/.github/settings.yml @@ -1,2 +1,2 @@ # This file was generated by Project Manager. -{"actions":{"permissions":{"workflow":{"can_approve_pull_request_reviews":true}}},"branches":[{"name":"main","protection":{"allow_force_pushes":false,"enforce_admins":true,"required_linear_history":false,"required_pull_request_reviews":null,"required_status_checks":{"contexts":["build (8.6.1, macos-13)","build (--prefer-oldest, 8.6.1, macos-13)","build (8.8.1, macos-13)","build (--prefer-oldest, 8.8.1, macos-13)","build (8.10.1, macos-13)","build (--prefer-oldest, 8.10.1, macos-13)","build (9.0.1, macos-13)","build (--prefer-oldest, 9.0.1, macos-13)","build (9.2.1, macos-13)","build (--prefer-oldest, 9.2.1, macos-13)","build (9.4.1, macos-13)","build (--prefer-oldest, 9.4.1, macos-13)","build (9.6.1, macos-13)","build (--prefer-oldest, 9.6.1, macos-13)","build (9.8.1, macos-13)","build (--prefer-oldest, 9.8.1, macos-13)","build (8.6.1, ubuntu-22.04)","build (--prefer-oldest, 8.6.1, ubuntu-22.04)","build (8.8.1, ubuntu-22.04)","build (--prefer-oldest, 8.8.1, ubuntu-22.04)","build (8.10.1, ubuntu-22.04)","build (--prefer-oldest, 8.10.1, ubuntu-22.04)","build (9.0.1, ubuntu-22.04)","build (--prefer-oldest, 9.0.1, ubuntu-22.04)","build (9.2.1, ubuntu-22.04)","build (--prefer-oldest, 9.2.1, ubuntu-22.04)","build (9.4.1, ubuntu-22.04)","build (--prefer-oldest, 9.4.1, ubuntu-22.04)","build (9.6.1, ubuntu-22.04)","build (--prefer-oldest, 9.6.1, ubuntu-22.04)","build (9.8.1, ubuntu-22.04)","build (--prefer-oldest, 9.8.1, ubuntu-22.04)","build (8.6.1, windows-2022)","build (--prefer-oldest, 8.6.1, windows-2022)","build (8.8.1, windows-2022)","build (--prefer-oldest, 8.8.1, windows-2022)","build (8.10.1, windows-2022)","build (--prefer-oldest, 8.10.1, windows-2022)","build (9.0.1, windows-2022)","build (--prefer-oldest, 9.0.1, windows-2022)","build (9.2.1, windows-2022)","build (--prefer-oldest, 9.2.1, windows-2022)","build (9.4.1, windows-2022)","build (--prefer-oldest, 9.4.1, windows-2022)","build (9.6.1, windows-2022)","build (--prefer-oldest, 9.6.1, windows-2022)","build (9.8.1, windows-2022)","build (--prefer-oldest, 9.8.1, windows-2022)","devShell ghcghc948 [aarch64-darwin]","package ghcaarch64-darwin_all [aarch64-darwin]","devShell ghcghc8107 [aarch64-darwin]","package ghcaarch64-darwin_all [aarch64-darwin]","devShell ghcghc902 [aarch64-darwin]","package ghcaarch64-darwin_all [aarch64-darwin]","devShell ghcghc924 [aarch64-darwin]","package ghcaarch64-darwin_all [aarch64-darwin]","devShell ghcghc942 [aarch64-darwin]","package ghcaarch64-darwin_all [aarch64-darwin]","devShell ghcghc962 [aarch64-darwin]","package ghcaarch64-darwin_all [aarch64-darwin]","devShell ghcghc981 [aarch64-darwin]","package ghcaarch64-darwin_all [aarch64-darwin]","homeConfig aarch64-darwin-haskerwaul-example","package default [aarch64-darwin]","check formatter [aarch64-darwin]","check project-manager-files [aarch64-darwin]","check vale [aarch64-darwin]","devShell default [aarch64-darwin]","devShell ghcghc948 [aarch64-linux]","package ghcaarch64-linux_all [aarch64-linux]","devShell ghcghc8107 [aarch64-linux]","package ghcaarch64-linux_all [aarch64-linux]","devShell ghcghc902 [aarch64-linux]","package ghcaarch64-linux_all [aarch64-linux]","devShell ghcghc924 [aarch64-linux]","package ghcaarch64-linux_all [aarch64-linux]","devShell ghcghc942 [aarch64-linux]","package ghcaarch64-linux_all [aarch64-linux]","devShell ghcghc962 [aarch64-linux]","package ghcaarch64-linux_all [aarch64-linux]","devShell ghcghc981 [aarch64-linux]","package ghcaarch64-linux_all [aarch64-linux]","devShell ghcghc884 [aarch64-linux]","package ghcaarch64-linux_all [aarch64-linux]","homeConfig aarch64-linux-haskerwaul-example","package default [aarch64-linux]","check formatter [aarch64-linux]","check project-manager-files [aarch64-linux]","check vale [aarch64-linux]","devShell default [aarch64-linux]","devShell ghcghc948 [x86_64-linux]","package ghcx86_64-linux_all [x86_64-linux]","devShell ghcghc8107 [x86_64-linux]","package ghcx86_64-linux_all [x86_64-linux]","devShell ghcghc902 [x86_64-linux]","package ghcx86_64-linux_all [x86_64-linux]","devShell ghcghc924 [x86_64-linux]","package ghcx86_64-linux_all [x86_64-linux]","devShell ghcghc942 [x86_64-linux]","package ghcx86_64-linux_all [x86_64-linux]","devShell ghcghc962 [x86_64-linux]","package ghcx86_64-linux_all [x86_64-linux]","devShell ghcghc981 [x86_64-linux]","package ghcx86_64-linux_all [x86_64-linux]","devShell ghcghc884 [x86_64-linux]","package ghcx86_64-linux_all [x86_64-linux]","homeConfig x86_64-linux-haskerwaul-example","package default [x86_64-linux]","check formatter [x86_64-linux]","check project-manager-files [x86_64-linux]","check vale [x86_64-linux]","devShell default [x86_64-linux]","devShell ghcghc948 [i686-linux]","package ghci686-linux_all [i686-linux]","devShell ghcghc8107 [i686-linux]","package ghci686-linux_all [i686-linux]","devShell ghcghc902 [i686-linux]","package ghci686-linux_all [i686-linux]","devShell ghcghc924 [i686-linux]","package ghci686-linux_all [i686-linux]","devShell ghcghc942 [i686-linux]","package ghci686-linux_all [i686-linux]","devShell ghcghc962 [i686-linux]","package ghci686-linux_all [i686-linux]","devShell ghcghc981 [i686-linux]","package ghci686-linux_all [i686-linux]","devShell ghcghc884 [i686-linux]","package ghci686-linux_all [i686-linux]","homeConfig i686-linux-haskerwaul-example","package default [i686-linux]","check formatter [i686-linux]","check project-manager-files [i686-linux]","check vale [i686-linux]","devShell default [i686-linux]"],"strict":false},"restrictions":null}}],"labels":[{"color":"","description":"Created automatically by some service or process","name":"automated"},{"color":"#d73a4a","description":"Something isn’t working","name":"bug"},{"color":"#333333","description":"Updates or other changes to dependencies","name":"dependencies"},{"color":"#0075ca","description":"Improvements or additions to documentation","name":"documentation"},{"color":"#a2eeef","description":"New feature or request","name":"enhancement"},{"color":"#7057ff","description":"Good for newcomers","name":"good first issue"},{"color":"#000000","description":"Issues you want contributors to help with.","name":"hacktoberfest"},{"color":"#ff7518","description":"Indicates acceptance for Hacktoberfest criteria, even if not merged yet.","name":"hacktoberfest-accepted"},{"color":"#008672","description":"Extra attention is needed","name":"help wanted"},{"color":"#333333","description":"Unaccepted contributions that haven’t been closed for some reason.","name":"invalid"},{"color":"#d876e3","description":"Further information is requested","name":"question"},{"color":"#ffc0cb","description":"Topic created in bad faith. Services like Hacktoberfest use this to identify bad actors.","name":"spam"},{"color":"#d4af37","description":"Work prioritized by a sponsor","name":"sponsored"}],"repository":{"allow_merge_commit":true,"allow_rebase_merge":false,"allow_squash_merge":false,"default_branch":"main","delete_branch_on_merge":true,"description":"Category-parametric programming","enable_automated_security_fixes":true,"enable_vulnerability_alerts":true,"has_downloads":false,"has_issues":true,"has_projects":true,"has_wiki":true,"merge_commit_message":"PR_BODY","merge_commit_title":"PR_TITLE","name":"haskerwaul","private":false,"topics":"hacktoberfest"}} \ No newline at end of file +{"actions":{"permissions":{"workflow":{"can_approve_pull_request_reviews":true}}},"branches":[{"name":"main","protection":{"allow_force_pushes":false,"enforce_admins":true,"required_linear_history":false,"required_pull_request_reviews":null,"required_status_checks":{"contexts":["check-bounds","build (8.6.1, macos-13)","build (--prefer-oldest, 8.6.1, macos-13)","build (8.8.1, macos-13)","build (--prefer-oldest, 8.8.1, macos-13)","build (8.10.1, macos-13)","build (--prefer-oldest, 8.10.1, macos-13)","build (9.0.1, macos-13)","build (--prefer-oldest, 9.0.1, macos-13)","build (9.2.1, macos-13)","build (--prefer-oldest, 9.2.1, macos-13)","build (9.4.1, macos-13)","build (--prefer-oldest, 9.4.1, macos-13)","build (9.6.1, macos-13)","build (--prefer-oldest, 9.6.1, macos-13)","build (9.8.1, macos-13)","build (--prefer-oldest, 9.8.1, macos-13)","build (9.10.1, macos-13)","build (--prefer-oldest, 9.10.1, macos-13)","build (8.6.1, macos-14)","build (--prefer-oldest, 8.6.1, macos-14)","build (8.8.1, macos-14)","build (--prefer-oldest, 8.8.1, macos-14)","build (8.10.1, macos-14)","build (--prefer-oldest, 8.10.1, macos-14)","build (9.0.1, macos-14)","build (--prefer-oldest, 9.0.1, macos-14)","build (9.2.1, macos-14)","build (--prefer-oldest, 9.2.1, macos-14)","build (9.4.1, macos-14)","build (--prefer-oldest, 9.4.1, macos-14)","build (9.6.1, macos-14)","build (--prefer-oldest, 9.6.1, macos-14)","build (9.8.1, macos-14)","build (--prefer-oldest, 9.8.1, macos-14)","build (9.10.1, macos-14)","build (--prefer-oldest, 9.10.1, macos-14)","build (8.6.1, ubuntu-22.04)","build (--prefer-oldest, 8.6.1, ubuntu-22.04)","build (8.8.1, ubuntu-22.04)","build (--prefer-oldest, 8.8.1, ubuntu-22.04)","build (8.10.1, ubuntu-22.04)","build (--prefer-oldest, 8.10.1, ubuntu-22.04)","build (9.0.1, ubuntu-22.04)","build (--prefer-oldest, 9.0.1, ubuntu-22.04)","build (9.2.1, ubuntu-22.04)","build (--prefer-oldest, 9.2.1, ubuntu-22.04)","build (9.4.1, ubuntu-22.04)","build (--prefer-oldest, 9.4.1, ubuntu-22.04)","build (9.6.1, ubuntu-22.04)","build (--prefer-oldest, 9.6.1, ubuntu-22.04)","build (9.8.1, ubuntu-22.04)","build (--prefer-oldest, 9.8.1, ubuntu-22.04)","build (9.10.1, ubuntu-22.04)","build (--prefer-oldest, 9.10.1, ubuntu-22.04)","build (8.6.1, windows-2022)","build (--prefer-oldest, 8.6.1, windows-2022)","build (8.8.1, windows-2022)","build (--prefer-oldest, 8.8.1, windows-2022)","build (8.10.1, windows-2022)","build (--prefer-oldest, 8.10.1, windows-2022)","build (9.0.1, windows-2022)","build (--prefer-oldest, 9.0.1, windows-2022)","build (9.2.1, windows-2022)","build (--prefer-oldest, 9.2.1, windows-2022)","build (9.4.1, windows-2022)","build (--prefer-oldest, 9.4.1, windows-2022)","build (9.6.1, windows-2022)","build (--prefer-oldest, 9.6.1, windows-2022)","build (9.8.1, windows-2022)","build (--prefer-oldest, 9.8.1, windows-2022)","build (9.10.1, windows-2022)","build (--prefer-oldest, 9.10.1, windows-2022)","devShell ghc965 [aarch64-darwin]","package ghc965_all [aarch64-darwin]","devShell ghc8107 [aarch64-darwin]","package ghc8107_all [aarch64-darwin]","devShell ghc902 [aarch64-darwin]","package ghc902_all [aarch64-darwin]","devShell ghc925 [aarch64-darwin]","package ghc925_all [aarch64-darwin]","devShell ghc945 [aarch64-darwin]","package ghc945_all [aarch64-darwin]","devShell ghc963 [aarch64-darwin]","package ghc963_all [aarch64-darwin]","devShell ghc981 [aarch64-darwin]","package ghc981_all [aarch64-darwin]","devShell ghc9101 [aarch64-darwin]","package ghc9101_all [aarch64-darwin]","homeConfig aarch64-darwin-haskerwaul-example","package default [aarch64-darwin]","check formatter [aarch64-darwin]","check project-manager-files [aarch64-darwin]","check vale [aarch64-darwin]","devShell default [aarch64-darwin]","devShell ghc965 [aarch64-linux]","package ghc965_all [aarch64-linux]","devShell ghc8107 [aarch64-linux]","package ghc8107_all [aarch64-linux]","devShell ghc902 [aarch64-linux]","package ghc902_all [aarch64-linux]","devShell ghc925 [aarch64-linux]","package ghc925_all [aarch64-linux]","devShell ghc945 [aarch64-linux]","package ghc945_all [aarch64-linux]","devShell ghc963 [aarch64-linux]","package ghc963_all [aarch64-linux]","devShell ghc981 [aarch64-linux]","package ghc981_all [aarch64-linux]","devShell ghc9101 [aarch64-linux]","package ghc9101_all [aarch64-linux]","homeConfig aarch64-linux-haskerwaul-example","package default [aarch64-linux]","check formatter [aarch64-linux]","check project-manager-files [aarch64-linux]","check vale [aarch64-linux]","devShell default [aarch64-linux]","devShell ghc965 [x86_64-linux]","package ghc965_all [x86_64-linux]","devShell ghc8107 [x86_64-linux]","package ghc8107_all [x86_64-linux]","devShell ghc902 [x86_64-linux]","package ghc902_all [x86_64-linux]","devShell ghc925 [x86_64-linux]","package ghc925_all [x86_64-linux]","devShell ghc945 [x86_64-linux]","package ghc945_all [x86_64-linux]","devShell ghc963 [x86_64-linux]","package ghc963_all [x86_64-linux]","devShell ghc981 [x86_64-linux]","package ghc981_all [x86_64-linux]","devShell ghc9101 [x86_64-linux]","package ghc9101_all [x86_64-linux]","homeConfig x86_64-linux-haskerwaul-example","package default [x86_64-linux]","check formatter [x86_64-linux]","check project-manager-files [x86_64-linux]","check vale [x86_64-linux]","devShell default [x86_64-linux]","devShell ghc965 [i686-linux]","package ghc965_all [i686-linux]","devShell ghc8107 [i686-linux]","package ghc8107_all [i686-linux]","devShell ghc902 [i686-linux]","package ghc902_all [i686-linux]","devShell ghc925 [i686-linux]","package ghc925_all [i686-linux]","devShell ghc945 [i686-linux]","package ghc945_all [i686-linux]","devShell ghc963 [i686-linux]","package ghc963_all [i686-linux]","devShell ghc981 [i686-linux]","package ghc981_all [i686-linux]","devShell ghc9101 [i686-linux]","package ghc9101_all [i686-linux]","homeConfig i686-linux-haskerwaul-example","package default [i686-linux]","check formatter [i686-linux]","check project-manager-files [i686-linux]","check vale [i686-linux]","devShell default [i686-linux]"],"strict":false},"restrictions":null}}],"labels":[{"color":"","description":"Created automatically by some service or process","name":"automated"},{"color":"#d73a4a","description":"Something isn’t working","name":"bug"},{"color":"#333333","description":"Updates or other changes to dependencies","name":"dependencies"},{"color":"#0075ca","description":"Improvements or additions to documentation","name":"documentation"},{"color":"#a2eeef","description":"New feature or request","name":"enhancement"},{"color":"#7057ff","description":"Good for newcomers","name":"good first issue"},{"color":"#000000","description":"Issues you want contributors to help with.","name":"hacktoberfest"},{"color":"#ff7518","description":"Indicates acceptance for Hacktoberfest criteria, even if not merged yet.","name":"hacktoberfest-accepted"},{"color":"#008672","description":"Extra attention is needed","name":"help wanted"},{"color":"#333333","description":"Unaccepted contributions that haven’t been closed for some reason.","name":"invalid"},{"color":"#d876e3","description":"Further information is requested","name":"question"},{"color":"#ffc0cb","description":"Topic created in bad faith. Services like Hacktoberfest use this to identify bad actors.","name":"spam"},{"color":"#d4af37","description":"Work prioritized by a sponsor","name":"sponsored"}],"repository":{"allow_merge_commit":true,"allow_rebase_merge":false,"allow_squash_merge":false,"default_branch":"main","delete_branch_on_merge":true,"description":"Category-parametric programming","enable_automated_security_fixes":true,"enable_vulnerability_alerts":true,"has_downloads":false,"has_issues":true,"has_projects":true,"has_wiki":true,"merge_commit_message":"PR_BODY","merge_commit_title":"PR_TITLE","name":"haskerwaul","private":false,"topics":"hacktoberfest, category-theory"}} \ No newline at end of file diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 58e1dad..3cb90b3 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -1 +1 @@ -{"jobs":{"build":{"env":{"CONFIG":"--enable-tests --enable-benchmarks ${{ matrix.bounds }}"},"runs-on":"${{ matrix.os }}","steps":[{"uses":"actions/checkout@v4"},{"id":"setup-haskell-cabal","uses":"haskell-actions/setup@v2","with":{"cabal-version":"3.10.2.1","ghc-version":"${{ matrix.ghc }}"}},{"run":"cabal v2-freeze $CONFIG"},{"uses":"actions/cache@v4","with":{"key":"${{ runner.os }}-${{ matrix.ghc }}-${{ hashFiles('cabal.project.freeze') }}","path":"${{ steps.setup-haskell-cabal.outputs.cabal-store }}\ndist-newstyle\n"}},{"run":"cabal v2-build all $CONFIG"},{"run":"cabal v2-test all $CONFIG"},{"run":"mv dist-newstyle/cache/plan.json plan-${{ runner.os }}-${{ matrix.ghc }}${{ matrix.bounds }}.json"},{"name":"Upload build plan as artifact","uses":"actions/upload-artifact@v4","with":{"name":"plan-${{ runner.os }}-${{ matrix.ghc }}${{ matrix.bounds }}","path":"plan-${{ runner.os }}-${{ matrix.ghc }}${{ matrix.bounds }}.json"}}],"strategy":{"fail-fast":false,"matrix":{"bounds":["--prefer-oldest",""],"ghc":["8.6.1","8.8.1","8.10.1","9.0.1","9.2.1","9.4.1","9.6.1","9.8.1"],"os":["macos-13","ubuntu-22.04","windows-2022"]}}},"check-bounds":{"needs":["build"],"runs-on":"ubuntu-22.04","steps":[{"uses":"actions/checkout@v4"},{"id":"setup-haskell-cabal","uses":"haskell-actions/setup@v2","with":{"cabal-version":"3.10.2.1","ghc-version":"9.6.3"}},{"run":"cabal install cabal-plan-bounds"},{"name":"download Cabal plans","uses":"actions/download-artifact@v4","with":{"merge-multiple":true,"path":"plans","pattern":"plan-*"}},{"name":"Cabal plans considered in generated bounds","run":"find plans/"},{"name":"check if bounds have changed","run":"diffs=\"$(find . \\\n -name '*.cabal' \\\n -exec cabal-plan-bounds --dry-run plans/*.json --cabal {} \\;)\"\nif [[ -n \"$diffs\" ]]; then\n echo \"$diffs\"\n exit 1\nfi\n"}]}},"name":"CI","on":{"pull_request":{"types":["opened","synchronize"]},"push":{"branches":["main"]}}} \ No newline at end of file +{"jobs":{"build":{"env":{"CONFIG":"--enable-tests --enable-benchmarks ${{ matrix.bounds }}"},"runs-on":"${{ matrix.os }}","steps":[{"uses":"actions/checkout@v4"},{"id":"setup-haskell-cabal","uses":"haskell-actions/setup@v2","with":{"cabal-version":"3.10.3.0","ghc-version":"${{ matrix.ghc }}"}},{"run":"cabal v2-freeze $CONFIG"},{"uses":"actions/cache@v4","with":{"key":"${{ matrix.os }}-${{ matrix.ghc }}-${{ hashFiles('cabal.project.freeze') }}","path":"${{ steps.setup-haskell-cabal.outputs.cabal-store }}\ndist-newstyle\n"}},{"run":"cabal v2-build all $CONFIG"},{"run":"cabal v2-test all $CONFIG"},{"run":"mv dist-newstyle/cache/plan.json plan-${{ matrix.os }}-${{ matrix.ghc }}${{ matrix.bounds }}.json"},{"name":"Upload build plan as artifact","uses":"actions/upload-artifact@v4","with":{"name":"plan-${{ matrix.os }}-${{ matrix.ghc }}${{ matrix.bounds }}","path":"plan-${{ matrix.os }}-${{ matrix.ghc }}${{ matrix.bounds }}.json"}}],"strategy":{"fail-fast":false,"matrix":{"bounds":["--prefer-oldest",""],"exclude":[{"ghc":"7.10.3","os":"ubuntu-22.04"},{"ghc":"8.6.1","os":"macos-14"},{"ghc":"8.8.1","os":"macos-14"},{"ghc":"8.10.1","os":"macos-14"},{"ghc":"9.0.1","os":"macos-14"},{"ghc":"9.2.1","os":"macos-14"},{"ghc":"9.4.1","os":"macos-14"}],"ghc":["8.6.1","8.8.1","8.10.1","9.0.1","9.2.1","9.4.1","9.6.1","9.8.1","9.10.1"],"os":["macos-13","macos-14","ubuntu-22.04","windows-2022"]}}},"check-bounds":{"if":"always()","needs":["build"],"runs-on":"ubuntu-22.04","steps":[{"uses":"actions/checkout@v4"},{"id":"setup-haskell-cabal","uses":"haskell-actions/setup@v2","with":{"cabal-version":"3.10.3.0","ghc-version":"9.6.5"}},{"run":"cabal install cabal-plan-bounds"},{"name":"download Cabal plans","uses":"actions/download-artifact@v4","with":{"merge-multiple":true,"path":"plans","pattern":"plan-*"}},{"name":"Cabal plans considered in generated bounds","run":"find plans/"},{"name":"check if bounds have changed","run":"diffs=\"$(find . -name '*.cabal' -exec \\\n cabal-plan-bounds \\\n --dry-run \\\n \\\n plans/*.json \\\n --cabal {} \\;)\"\nif [[ -n \"$diffs\" ]]; then\n echo \"$diffs\"\n exit 1\nfi\n"}]},"check-licenses":{"if":"always()","needs":["build"],"runs-on":"ubuntu-22.04","steps":[{"uses":"actions/checkout@v4"},{"id":"setup-haskell-cabal","uses":"haskell-actions/setup@v2","with":{"cabal-version":"3.10.3.0","ghc-version":"9.6.5"}},{"run":"cabal install cabal-plan -flicense-report"},{"name":"download Cabal plans","uses":"actions/download-artifact@v4","with":{"merge-multiple":true,"path":"plans","pattern":"plan-*"}},{"run":"mkdir -p dist-newstyle/cache\nmv plans/plan-ubuntu-22.04-9.10.1.json dist-newstyle/cache/plan.json\n"},{"name":"check if licenses have changed","run":"declare -A packages=(['haskerwaul']='haskerwaul' ['haskerwaul-base']='base' ['haskerwaul-hedgehog']='hedgehog' ['haskerwaul-trample']='trample')\nfor package in \"${!packages[@]}\"; do\n {\n echo \"**NB**: This captures the licenses associated with a particular set of dependency versions. If your own build solves differently, it’s possible that the licenses may have changed, or even that the set of dependencies itself is different. Please make sure you run [\\`cabal-plan license-report\\`](https://hackage.haskell.org/package/cabal-plan) on your own components rather than assuming this is authoritative.\"\n echo\n cabal-plan license-report \"$package:lib:$package\"\n } >\"${packages[$package]}/docs/license-report.md\"\ndone\ngit diff --exit-code */docs/license-report.md\n"}]}},"name":"CI","on":{"pull_request":{"types":["opened","synchronize"]},"push":{"branches":["main"]}}} \ No newline at end of file diff --git a/.github/workflows/hackage-publish.yml b/.github/workflows/hackage-publish.yml index ac63a8f..73a8bae 100644 --- a/.github/workflows/hackage-publish.yml +++ b/.github/workflows/hackage-publish.yml @@ -1 +1 @@ -{"jobs":{"hackage-publish":{"permissions":{"contents":"read","id-token":"write"},"runs-on":"ubuntu-latest","steps":[{"uses":"actions/checkout@v4","with":{"ref":"${{ (inputs.tag != null) && format('refs/tags/{0}', inputs.tag) || '' }}"}},{"uses":"haskell-actions/hackage-publish@v1","with":{"hackageToken":"${{ secrets.HACKAGE_AUTH_TOKEN }}","packagesPath":"${{ runner.temp }}/packages","publish":false}}]}},"name":"Publish release to Hackage","on":{"push":{"tags":["v?[0-9]+.[0-9]+.[0-9]+*"]},"workflow_dispatch":{"inputs":{"tag":{"description":"The existing version to publish to Hackage","required":true,"type":"string"}}}}} \ No newline at end of file +{"jobs":{"hackage-publish":{"permissions":{"contents":"read","id-token":"write"},"runs-on":"ubuntu-latest","steps":[{"uses":"actions/checkout@v4","with":{"ref":"${{ (inputs.tag != null) && format('refs/tags/{0}', inputs.tag) || '' }}"}},{"id":"setup-haskell-cabal","uses":"haskell-actions/setup@v2","with":{"cabal-version":"3.10.3.0","ghc-version":"9.10.1"}},{"run":"cabal v2-sdist --output-directory='$/packages/' all"},{"uses":"haskell-actions/hackage-publish@v1","with":{"hackageToken":"${{ secrets.HACKAGE_AUTH_TOKEN }}","packagesPath":"$/packages/","publish":false}}]}},"name":"Publish release to Hackage","on":{"push":{"tags":["v?[0-9]+.[0-9]+.[0-9]+*"]},"workflow_dispatch":{"inputs":{"tag":{"description":"The existing version to publish to Hackage","required":true,"type":"string"}}}}} \ No newline at end of file diff --git a/README.md b/README.md index 46bab65..a24bc44 100644 --- a/README.md +++ b/README.md @@ -1,191 +1,17 @@ # Haskerwaul -[![built with garnix](https://img.shields.io/endpoint?url=https%3A%2F%2Fgarnix.io%2Fapi%2Fbadges%2Fsellout%2Fhaskerwaul)](https://garnix.io) -[![Packaging status](https://repology.org/badge/tiny-repos/haskell:haskerwaul.svg)](https://repology.org/project/haskell:haskerwaul/versions) -[![latest packaged versions](https://repology.org/badge/latest-versions/haskell:haskerwaul.svg)](https://repology.org/project/haskell:haskerwaul/versions) +[![built with garnix](https://img.shields.io/endpoint?url=https%3A%2F%2Fgarnix.io%2Fapi%2Fbadges%2Fsellout%2Fhaskerwaul)](https://garnix.io/repo/sellout/haskerwaul) Howling into the primordial ooze of category theory. -## overview - -This library gives an extremely abstract presentation of various CT and abstract algebra concepts. - -The structure is largely based on [nLab](https://ncatlab.org/nlab/show/HomePage), with some additional references to [Wikipedia](https://www.wikipedia.org/). I've tried to link to as many pages as possible throughout the library to make it easy to understand all the concepts (or, at least as easy as getting your head around category theory is likely to be). - ## usage -This library attempts to play well with the existing type classes in base. E.g., we promote instances from base with instances like this: - -```haskell -instance - {-# OVERLAPPABLE #-} - (Data.Functor.Functor f) => - Haskerwaul.Functor.Functor (->) (->) f - where - map = Data.Functor.fmap -``` - -Which also means that if you're defining your own instances, you'd be well-served to implement them using the type classes from base whenever possible, getting a bunch of Haskerwaul instances for free (e.g., if you implement `Control.Category.Category`, I think you must get at least three separate Haskerwaul instances ([`Magma`](./src/Haskerwaul/Magma.hs), [`Semigroup`](./src/Haskerwaul/Semigroup.hs), and [`UnitalMagma`](./src/Haskerwaul/Magma/Unital.hs) -- things like [`Semicategory`](./src/Haskerwaul/Semicategory.hs) and [`Category`](./src/Haskerwaul/Category.hs) are either type synonyms or have universal instances already defined. Once you have the instance from base, you can implement richer classes like `CartesianClosedCategory` using Haskerwaul's classes. - -However, this library does not play well with `Prelude`, co-opting a bunch of the same names, so it's helpful to either enable `NoImplicitPrelude` or import Haskerwaul qualified. Unfortunately, [the `Haskerwaul` module](./src/Haskerwaul.hs) is not quite a custom Prelude and I've avoided expanding it into one, because there are a lot of points of contention when designing a Prelude. But perhaps it can be used as the basis of one. - -### varieties of categories - -- **Set**/**Hask** -- `(->)` -- `Constraint` -- `(:-)` -- [`Functor`](./src/Haskerwaul/Functor.hs) categories (including `Constraint`- - valued functors -- [`Bifunctor`](./src/Haskerwaul/Bifunctor.hs) categories (separate from functor - categories because we don't yet have real product categories) -- [`Opposite`](./src/Haskerwaul/Category/Opposite.hs) categories -- [`FullSubcategory`s](./src/Haskerwaul/Subcategory/Full.hs) by adding arbitrary - constraints, filtering the objects in the category -- [`Kleisli`](./src/Haskerwaul/Category/Kleisli.hs) (and - [`CoKleisli`](./src/Haskerwaul/Category/CoKleisli.hs)) categories over - arbitrary categories -- [`ClosedCategory`s](./src/Haskerwaul/Category/Closed.hs) (beyond **Set**, and - even beyond ones that have objects of kind `Type`) - -## naming conventions - -### types and classes - -The names we use generally come from [nLab](https://ncatlab.org/nlab/show/HomePage), and I've tried to include links into nLab as much as possible in the Haddock. - -### type parameters - -There are a lot of one-character type parameters here, but we try to use them at least somewhat consistently. - -- `ok` -- _kinds_ of the objects in a category -- `ob` -- _constraints_ on the objects in a category -- `c`, `c'`, `d`, ... -- categories representing the arrows of the category (kind `ok -> ok -> Type`) -- `a`, `b`, `x`, `y`, `z` -- objects in a category and/or elements of those objects (kind `ok`) -- `t`, `t'`, `ct`, `dt` -- tensors (kind `ok -> ok -> ok`) in a category (`ct` and `dt` distinguish when we're talking about tensors in categories `c` and `d`) - -## [horizontal categorification](https://ncatlab.org/nlab/show/horizontal+categorification) / oidification - -Horizontally categorified concepts are generally defined via type synonyms. -E.g., the most central concept in this library is `Category`, which is defined -simply as - -```haskell -type Category = HorizontalCategorification Monoid -``` - -See [the -examples](https://ncatlab.org/nlab/show/horizontal+categorification#examples) -for a more comprehensive list. - -In cases where we can't simply use type synonyms, the Haddock should describe -why. - -## law checking - -Haskerwaul attempts to make it as easy and flexible as possible to test laws -using whatever mechanism you already use in your projects. We do this by -breaking things into relatively small pieces. - -- Individual laws are defined under `Haskerwaul.Law` and should be minimally - constrained, taking the required morphisms as arguments. These build a `Law` - structure, which is basically just a tuple of morphisms that should commute. -- Aggregate laws for a structure are defined in - `Haskerwaul..Laws`. These should accumulate all the laws for their - substructures as well. - -The former are defined as abstractly as possible (e.g., you can often define a -law for an arbitrary `MonoidalCategory`), while the latter currently require at -least an `ElementaryTopos` in order to get the characteristic morphism. However, -as you can see in `Haskerwaul.Semigroup.Laws` the laws can still be checked -against tensors other than the Cartesian product. - -To test these laws, you need an `ElementaryTopos` for your testing -library. There is one for [Hedgehog](https://hedgehog.qa/) included. This then -lets you map each structure's laws into your topos, so you can test your own -instances. Since the structure laws are cumulative, this means you don't need -tests for `Magma _ _ Foo`, `UnitalMagma _ _ Foo`, etc. You should be able to do -a single test of `Group _ _ Foo`. - -**NB**: One shortcoming is that since the structures are cumulative, and there -are often shared sub-structures in the tree, we currently end up testing the -more basic laws multiple times for a richer structure. It would be good to build -up the laws without duplication. - -## what to work on - -There are various patterns that indicate something can be improved. - -### `__TODO__` or `__FIXME__` - -These are the usual labels in comments to indicate that there is more work to be done on something. (The double-underscore on either side indicates to [Haddock](https://www.haskell.org/haddock/) that it should be bold when included in documentation.) - -### `~ (->)`, `~ (,)`, `~ All` - -Patterns like these are used when an instance has to be over-constrained. This -way we still get to use the type parameters we want in the instance declaration -and also have a way to `grep` for cases that are overconstrained, while arriving -at something that works in the mean time. - -### newtypes +See the individual package READMEs for usage information -Newtypes are commonly used to workaround the "uniqueness" of instances. However, -aside from the other issues that we won't get into here, the fact that newtypes -are restricted to **Hask** means that we are often very overconstrained as a -result (see `~ (->)` above). - -So, we try to avoid newtypes as much as possible. In `base`, you see things like - -```haskell -newtype Ap f a = Ap { getAp :: f a } -instance (Applicative f, Monoid a) => Monoid (Ap f a) where - ... -``` - -but that forces `f :: k -> Type` (granted, `Applicative` already forces -`f :: Type -> Type`, so it's no loss in `base`). However, we want to stay more -kind-polymorphic, so we take a different tradeoff and write stuff like - -```haskell -instance (LaxMonoidalFunctor c ct d dt f, Monoid c ct a) => Monoid d dt (f a) -``` - -(where `LaxMonoidalFunctor` is our equivalent of `Applicative`), which means we -need `UndecidableInstances`, but it's worth it to be kind-polymorphic. - -### relations - -The way relations are currently implemented means that an `EqualityRelation` -_is_ a `PartialOrder`, and since these are defined with type classes, it means -the `PartialOrder` that is richer than the discrete one implied by the -`EqualityRelation` needs to be made distinct via a newtype. And similarly, the -(unique) `EqualityRelation` also needs a newtype to make it distinct from the -`InequalityRelation` that it's derived from. -`nix build` will build and test the project fully. - -See "newtypes" above. - -### enriched categories - -In "plain" category theory, the Hom functor for a category **C** is a functor **C** x **C** -> **Set**. Enriched category theory generalizes that **Set** to some arbitrary monoidal category **V**. E.g., in the case of preorders, **V** may be **Set** (where the image is only singleton sets and the empty set) or it can be **Bool**, which more precisely models the exists-or-not nature of the relationship. - -One way to model this is to add a parameter `v` to `Category c`, like - -```haskell -class Monoid (DinaturalTransformation v) Procompose c => Category v c -``` - -However, this means that the same category, enriched differently, has multiple instances. Modeling the enrichment separaetely, e.g., - -```haskell -class (MonoidalCategory v, Category c) => EnrichedCategory v c -``` - -seems good, but the Hom functor is fundamental to the definition of composition in `c`. Finally, perhaps we can encode some "primary" **V** existentially, and model other enrichments via functors from **V**. - -### PolyKinds - -This library strives to take advantage of `PolyKinds`, which make it possible to say things like `Category ~ Monoid (NaturalTransformation (->)) Procompose`, however we use newtypes like `Additive` and `Multiplicative` to say things like `Semiring a ~ (Monoid (Additive a), Monoid (Multiplicative a))`, and since fully-applied type constructors need to have kind `Type` it means that `Semiring` _isn't_ kind-polymorphic. - -As a result, at various places in the code we find ourselves stuck dealing with `Type` when we'd like to remain polymorphic. Remedying this would be very helpful. +- [`haskerwaul`](./haskerwaul/README.md) – the core library +- [`haskerwaul-base`](./haskerwaul-base/README.md) – a mostly drop-in replacement for `base` +- [`haskerwaul-hedgehog`](./haskerwaul-hedgehog/README.md) – integration with [Hedgehog](https://github.com/hedgehogqa/haskell-hedgehog#readme) for testing Haskerwaul +- [`haskerwaul-trample`](./haskerwaul-trample/README.md) – like `haskerwaul-base`, but with identical package names as `base` ## development environment @@ -199,9 +25,9 @@ This command ensures that any work you do within this repository is done within This will apply our repository-specific Git configuration to `git` commands run against this repository. It’s lightweight (you should definitely look at it before applying this command) – it does things like telling `git blame` to ignore formatting-only commits. -## building & development +## building -Especially if you are unfamiliar with the haskell ecosystem, there is a Nix build (both with and without a flake). If you are unfamiliar with Nix, [Nix adjacent](...) can help you get things working in the shortest time and least effort possible. +Especially if you are unfamiliar with the Haskell ecosystem, there is a Nix build (both with and without a flake). If you are unfamiliar with Nix, [Nix adjacent](...) can help you get things working in the shortest time and least effort possible. ### if you have `nix` installed @@ -213,44 +39,59 @@ Especially if you are unfamiliar with the haskell ecosystem, there is a Nix buil This project is built with [Cabal](https://cabal.readthedocs.io/en/stable/index.html). Individual packages will work with older versions, but ./cabal.package requires Cabal 3.6+. -## versioning +## development -In the absolute, almost every change is a breaking change. This section describes how we mitigate that to provide minor updates and revisions. +### CI failures -Here are some common changes that can have unintended effects: +There are a few jobs that may fail during CI and indicate specific changes that need to be made to your PR. If you run into any failures other than those that are listed here, they likely have remedies that are specific to your changes. If you need help replicating or resolving them, or think that they represent general patterns like the ones listed below, inform the maintainers. They can help you resolve them and decide if they should be called out with generic resolution processes. -- adding instances can conflict with downstream orphans, -- adding a module can conflict with a module from another package, -- adding a definition to an existing module can conflict if there are unqualified imports, and -- even small bugfixes can introduce breaking changes where downstream depended on the broken results. +#### CI / check-bounds (check if bounds have changed) -To mitigate some of those issues for versioning, we assume the following usage: +A failure in the “check if bounds have changed” step indicates that the bounds on direct dependencies have changed. -- modules should be imported using `PackageImports`, so that adding modules is a _minor_ change; -- modules should be imported qualified, so that adding definitions is a _minor_ change; -- adding instances can't be mitigated in the same way, and it's not uncommon for downstream libraries to add orphans instances when they're omitted from upstream libraries. However, since these conflicts can only happen via direct dependencies, and represent an explicit downstream workaround, it’s reasonable to expect a quick downstream update to remove or conditionalize the workaround. So, this is considered a _minor major_ change; -- deprecation is considered a _revision_ change, however it will often be paired with _minor_ changes. `-Werror` can cause this to fail, but published libraries shouldn't be compiled with `-Werror`. +It currently means that the discovered bounds have been restricted, which is always a breaking change. Unfortunately, this is sometimes not due to anything in the PR, but it does indicate we’re no longer testing the versions we used to – the Cabal solver will sometimes start choosing different packages, depending on releases. Due to the behavior of the solver, the most likely ones to change are in the middle of the range. There are a few ways to address this problem: -## comparisons +1. Simply change the bounds as the output recommends, and make sure the PR bumps the major version number. If this change is already bumping the major version, this is probably the right choice to make. +2. Try to force Cabal to try the previous bounds. If you had manually changed the bounds because you needed some new feature, is it possible to conditionalize use of that feature so that we can also still use and test with older bounds? +3. Tell CI that you want to keep the bounds the same even though they’re not tested. You do this by adding the old bound to the `extraDependencyVersions` list in flake.nix. This should be done carefully, but one use case is where those bounds _are_ tested by the Nix builds, but not by GitHub. + +#### CI / check-licenses (check if licenses have changed) -There are a number of libraries that attempt to encode categories in various ways. I try to explain how Haskerwaul compares to each of them, to make it easier to decide what you want to use for your own project. I would be very happy to get additional input for this section from people who have used these other libraries (even if it's just to ask a question, like "how does Haskerwaul's approach to X compare to SubHask, which does Y?"). +This means there has _possibly_ been some change in the licensing, but it’s not foolproof. This only captures the licensing for one particular Cabal solution, so other solutions may have different transitive dependencies or licenses. -In general, Haskerwaul is much more fine-grained than other libraries. It also has many small modules with minimal dependencies between them. Haskerwaul is also not quite as ergonomic as other libraries in many situations. E.g., `Magma`'s `op` is the least meaninful name possible and it occurs _everywhere_ in polymorphic functions, meaning anything from function composition to addition, meet, join, etc. And there are currently plenty of places where (thanks to `newtype`s) the category ends up constrained to `->`, which is a very frustrating limitation. +If there is a new license type in the list, it could affect how consumers of this can use our library. If the new license isn’t compatible with the existing set, then that’s a breaking change. If a package has changed its license, then we can alternatively restrict that package to versions that only use the previous license. Since making a license more restrictive introduces incompatibilities, this should only happen when they bump their major version, but there is no guarantee. In that case, this should just prevent us from extending the bounds, which is fine. But if it requires restricting bounds at the minor or revision level, then that’s still a breaking change on our side. Ideally we wouldn’t have to restrict that, but just make sure the consumer is informed about the license change and how to avoid it, but I don’t know how to convey that yet. -### [algebra](http://hackage.haskell.org/package/algebra) +If there is a new dependency that has appeared, that should already be reflected in a major version bump. However, not all libraries introduce a major version bump when they add a dependency, and supporting wider version ranges means we may pick up a new dependency without excluding solutions that don’t involve that dependency. -### [categories](http://hackage.haskell.org/package/categories) +It’s tempting to think that moving a dependency from the transitive list to the direct list doesn’t involve a version bump, but that’s not necessarily true. First, the transitive dependency must exist on all possible dependency solutions for that to be true. Then, it’s also possible for a new revision of a library to _remove_ dependencies, which means they will no longer appear in the transitive graph, invalidating our previous assumption. For this reason, we shouldn’t treat a move from transitive to direct as any different from a new dependency. -This adds a handful of the concepts defined in Haskerwaul, and those it includes are designed to be compatible with the existing `Category` type class in `base`. E.g., the categories are not constrained. Haskerwaul's `Category` is generalized and fits into a much larger framework of categorical concepts. +#### check formatter -### [concat](https://github.com/conal/concat) +There is some unformatted code (or perhaps some lint that needs addressing). If you use Nix, running `nix fmt` should automatically fix most of the formatting, and at least report additional lint that needs addressing. -The primary component of this is a compiler plugin for category-based rewriting. However, it needs a category hierarchy to perform the rewrites on, so it provides one of its own. The hierarchy is pretty small, restricts objects to kind `Type`, also has a single definition for products, coproducts, exponentials, etc., which reduces the flexibility a lot. Finally, concat has some naming conventions (and hierarchy) that perhaps better serves Haskell programmers understanding the mechanism than modeling categorical concepts. I.e., it uses names like `NumCat`, which is a `Category`-polymorphic `Num` class rather than a name like `Ring` that ties it more to category theory (or at least abstract algebra). +If you don’t use Nix, the CI log should contain some lines like -### [constrained-categories](https://hackage.haskell.org/package/constrained-categories) +``` +treefmt 0.6.1 +[INFO ] #alejandra: 1 files processed in 43.00ms +[INFO ] #prettier: 7 files processed in 423.85ms +[INFO ] #ormolu: 39 files processed in 1.60s +[INFO ] #hlint: 39 files processed in 2.15s +0 files changed in 2s (found 66, matched 86, cache misses 86) +``` + +Those `INFO` lines indicate which formatters were run. Running those same ones individually should address the issues. You can also just indicate in your PR that you don’t use Nix, and a maintainer will happily fix the formatting for you. + +This implies a revision bump in any package that has been reformatted, as well as a revision bump in the repository. -### [HaskellForMaths](http://hackage.haskell.org/package/HaskellForMaths) +#### check project-manager-files -### [SubHask](http://hackage.haskell.org/package/subhask) +Some files committed to the repository don’t match the ones that would be generated by Project Manager. This can happen either because you modified some of the Nix project configuration and forgot to regenerate the files, or because you edited generated files directly rather than editing the Nix project configuration. + +If you use Nix, running `project-manager switch` from a project dev shell (or `nix run github:sellout/project-manager -- switch`) anywhere should fix this (although check to see if you lost intentional changes to generated files, and add them via the Nix project configuration instead). + +If you don’t use Nix, you will need to mention that in your PR so that one of the maintainers can resolve this for you. + +## comparisons -SubHask uses a similar mechanism for subcategories, an associated type family (`ValidCategory` as opposed to `Ob`) to add constraints to operations. But it doesn't generalize across kinds (e.g., a `Category` isn't a `Monoid`). It also doesn't allow categories to be monoidal in multiple ways, as the tensor is existential. +See [the package README](./haskerwaul/README.md) for comparisons with other similar projects. diff --git a/base/CHANGELOG.md b/base/CHANGELOG.md new file mode 100644 index 0000000..a7bec31 --- /dev/null +++ b/base/CHANGELOG.md @@ -0,0 +1,12 @@ +# Changelog + +All notable changes to this project will be documented in this file. + +The format is based on [Keep a Changelog 1.1](https://keepachangelog.com/en/1.1.0/), +and this project adheres to the [Haskell Package Versioning Policy](https://pvp.haskell.org/). + +## [0.1.0.0] - 2024-08-28 + +### Added + +- initial release of this package diff --git a/base/README.md b/base/README.md new file mode 100644 index 0000000..9e9fa34 --- /dev/null +++ b/base/README.md @@ -0,0 +1,98 @@ +# Haskerwaul Base + +[![Packaging status](https://repology.org/badge/tiny-repos/haskell:haskerwaul-base.svg)](https://repology.org/project/haskell:haskerwaul-base/versions) +[![latest packaged versions](https://repology.org/badge/latest-versions/haskell:haskerwaul-base.svg)](https://repology.org/project/haskell:haskerwaul-base/versions) + +## usage + +This package offers the same modules as `base`, but with each prefixed with `Haskerwaul.Base.`. You can update imports incrementally to see what works under Haskerwaul and what doesn’t. + +## licensing + +This package is licensed under [The GNU AGPL 3.0 or later](./LICENSE). If you need a license for usage that isn’t covered under the AGPL, please contact [Greg Pfeil](mailto:greg@technomadic.org?subject=licensing%20no-recursion). + +You should review the [license report](docs/license-report.md) for details about dependency licenses. + +## versioning + +This project largely follows the [Haskell Package Versioning Policy](https://pvp.haskell.org/) (PVP), but is more strict in some ways. + +The version always has four components, `A.B.C.D`. The first three correspond to those required by PVP, while the fourth matches the “patch” component from [Semantic Versioning](https://semver.org/). + +Here is a breakdown of some of the constraints: + +### sensitivity to additions to the API + +PVP recommends that clients follow [these import guidelines](https://wiki.haskell.org/Import_modules_properly) in order that they may be considered insensitive to additions to the API. However, this isn’t sufficient. We expect clients to follow these additional recommendations for API insensitivity + +If you don’t follow these recommendations (in addition to the ones made by PVP), you should ensure your dependencies don’t allow a range of `C` values. That is, your dependencies should look like + +```cabal +yaya >=1.2.3 && <1.2.4 +``` + +rather than + +```cabal +yaya >=1.2.3 && <1.3 +``` + +#### use package-qualified imports everywhere + +If your imports are [package-qualified](https://downloads.haskell.org/ghc/latest/docs/users_guide/exts/package_qualified_imports.html?highlight=packageimports#extension-PackageImports), then a dependency adding new modules can’t cause a conflict with modules you already import. + +#### avoid orphans + +Because of the transitivity of instances, orphans make you sensitive to your dependencies’ instances. If you have an orphan instance, you are sensitive to the APIs of the packages that define the class and the types of the instance. + +One way to minimize this sensitivity is to have a separate package (or packages) dedicated to any orphans you have. Those packages can be sensitive to their dependencies’ APIs, while the primary package remains insensitive, relying on the tighter ranges of the orphan packages to constrain the solver. + +### transitively breaking changes (increments `A`) + +#### removing a type class instance + +Type class instances are imported transitively, and thus changing them can impact packages that only have your package as a transitive dependency. + +#### widening a dependency range with new major versions + +This is a consequence of instances being transitively imported. A new major version of a dependency can remove instances, and that can break downstream clients that unwittingly depended on those instances. + +A library _may_ declare that it always bumps the `A` component when it removes an instance (as this policy dictates). In that case, only `A` widenings need to induce `A` bumps. `B` widenings can be `D` bumps like other widenings, Alternatively, one may compare the APIs when widening a dependency range, and if no instances have been removed, make it a `D` bump. + +### breaking changes (increments `B`) + +#### restricting an existing dependency’s version range in any way + +Consumers have to contend not only with our version bounds, but also with those of other libraries. It’s possible that some dependency overlapped in a very narrow way, and even just restricting a particular patch version of a dependency could make it impossible to find a dependency solution. + +#### restricting the license in any way + +Making a license more restrictive may prevent clients from being able to continue using the package. + +#### adding a dependency + +A new dependency may make it impossible to find a solution in the face of other packages dependency ranges. + +#### any change to fixity + +There is no change to fixity that can ensure it doesn’t break existing parses. + +### non-breaking changes (increments `C`) + +#### adding a module + +This is also what PVP recommends. However, unlike in PVP, this is because we recommend that package-qualified imports be used on all imports. + +### other changes (increments `D`) + +#### widening a dependency range for non-major versions + +This is fairly uncommon, in the face of `^>=`-style ranges, but it can happen in a few situations. + +#### deprecation + +**NB**: This case is _weaker_ than PVP, which indicates that packages should bump their major version when adding `deprecation` pragmas. + +We disagree with this because packages shouldn’t be _publishing_ with `-Werror`. The intent of deprecation is to indicate that some API _will_ change. To make that signal a major change itself defeats the purpose. You want people to start seeing that warning as soon as possible. The major change occurs when you actually remove the old API. + +Yes, in development, `-Werror` is often (and should be) used. However, that just helps developers be aware of deprecations more immediately. They can always add `-Wwarn=deprecation` in some scope if they need to avoid updating it for the time being. diff --git a/base/Setup.hs b/base/Setup.hs index aee59ef..4d53144 100644 --- a/base/Setup.hs +++ b/base/Setup.hs @@ -1,12 +1,17 @@ -- __NB__: `custom-setup` doesn’t have any way to specify extensions or options, -- so any we want need to be specified here. +{-# LANGUAGE CPP #-} {-# LANGUAGE PackageImports #-} {-# LANGUAGE Unsafe #-} {-# LANGUAGE NoImplicitPrelude #-} +#if MIN_VERSION_GLASGOW_HASKELL(8, 0, 0, 0) {-# OPTIONS_GHC -Weverything #-} -- Warns even when `Unsafe` is explicit, not inferred. See -- https://gitlab.haskell.org/ghc/ghc/-/issues/16689 {-# OPTIONS_GHC -Wno-unsafe #-} +#else +{-# OPTIONS_GHC -Wall #-} +#endif module Main (main) where diff --git a/base/docs/license-report.md b/base/docs/license-report.md new file mode 100644 index 0000000..b86042f --- /dev/null +++ b/base/docs/license-report.md @@ -0,0 +1,40 @@ +**NB**: This captures the licenses associated with a particular set of dependency versions. If your own build solves differently, it’s possible that the licenses may have changed, or even that the set of dependencies itself is different. Please make sure you run [`cabal-plan license-report`](https://hackage.haskell.org/package/cabal-plan) on your own components rather than assuming this is authoritative. + +# Dependency License Report + +Bold-faced **`package-name`**s denote standard libraries bundled with `ghc-9.10.1`. + +## Direct dependencies of `haskerwaul-base:lib:haskerwaul-base` + +| Name | Version | [SPDX](https://spdx.org/licenses/) License Id | Description | Also depended upon by | +| --- | --- | --- | --- | --- | +| **`base`** | [`4.20.0.0`](http://hackage.haskell.org/package/base-4.20.0.0) | [`BSD-3-Clause`](http://hackage.haskell.org/package/base-4.20.0.0/src/LICENSE) | Core data structures and operations | *(core library)* | +| `haskerwaul` | [`0.1.0.0`](http://hackage.haskell.org/package/haskerwaul-0.1.0.0) | *MISSING* | *MISSING* | | + +## Indirect transitive dependencies + +| Name | Version | [SPDX](https://spdx.org/licenses/) License Id | Description | Depended upon by | +| --- | --- | --- | --- | --- | +| **`array`** | [`0.5.7.0`](http://hackage.haskell.org/package/array-0.5.7.0) | [`BSD-3-Clause`](http://hackage.haskell.org/package/array-0.5.7.0/src/LICENSE) | Mutable and immutable arrays | `binary`, `containers`, `deepseq`, `stm`, `text` | +| **`binary`** | [`0.8.9.2`](http://hackage.haskell.org/package/binary-0.8.9.2) | [`BSD-3-Clause`](http://hackage.haskell.org/package/binary-0.8.9.2/src/LICENSE) | Binary serialisation for Haskell values using lazy ByteStrings | `constraints`, `text` | +| `boring` | [`0.2.2`](http://hackage.haskell.org/package/boring-0.2.2) | [`BSD-3-Clause`](http://hackage.haskell.org/package/boring-0.2.2/src/LICENSE) | Boring and Absurd types | `constraints` | +| **`bytestring`** | [`0.12.1.0`](http://hackage.haskell.org/package/bytestring-0.12.1.0) | [`BSD-3-Clause`](http://hackage.haskell.org/package/bytestring-0.12.1.0/src/LICENSE) | Fast, compact, strict and lazy byte strings with a list interface | `binary`, `filepath`, `hashable`, `os-string`, `text` | +| `constraints` | [`0.14.2`](http://hackage.haskell.org/package/constraints-0.14.2) | [`BSD-2-Clause`](http://hackage.haskell.org/package/constraints-0.14.2/src/LICENSE) | Constraint manipulation | `haskerwaul` | +| **`containers`** | [`0.7`](http://hackage.haskell.org/package/containers-0.7) | [`BSD-3-Clause`](http://hackage.haskell.org/package/containers-0.7/src/LICENSE) | Assorted concrete container types | `binary`, `hashable`, `haskerwaul` | +| **`deepseq`** | [`1.5.0.0`](http://hackage.haskell.org/package/deepseq-1.5.0.0) | [`BSD-3-Clause`](http://hackage.haskell.org/package/deepseq-1.5.0.0/src/LICENSE) | Deep evaluation of data structures | `bytestring`, `constraints`, `containers`, `filepath`, `hashable`, `os-string`, `pretty`, `tagged`, `text` | +| **`exceptions`** | [`0.10.7`](http://hackage.haskell.org/package/exceptions-0.10.7) | [`BSD-3-Clause`](http://hackage.haskell.org/package/exceptions-0.10.7/src/LICENSE) | Extensible optionally-pure exceptions | `filepath`, `os-string` | +| **`filepath`** | [`1.5.2.0`](http://hackage.haskell.org/package/filepath-1.5.2.0) | [`BSD-3-Clause`](http://hackage.haskell.org/package/filepath-1.5.2.0/src/LICENSE) | Library for manipulating FilePaths in a cross platform way. | `hashable` | +| **`ghc-bignum`** | [`1.3`](http://hackage.haskell.org/package/ghc-bignum-1.3) | [`BSD-3-Clause`](http://hackage.haskell.org/package/ghc-bignum-1.3/src/LICENSE) | GHC BigNum library | `ghc-internal`, `hashable` | +| **`ghc-boot-th`** | [`9.10.1`](http://hackage.haskell.org/package/ghc-boot-th-9.10.1) | [`BSD-3-Clause`](http://hackage.haskell.org/package/ghc-boot-th-9.10.1/src/LICENSE) | Shared functionality between GHC and the @template-haskell@ library | `template-haskell` | +| **`ghc-internal`** | [`9.1001.0`](http://hackage.haskell.org/package/ghc-internal-9.1001.0) | [`BSD-3-Clause`](http://hackage.haskell.org/package/ghc-internal-9.1001.0/src/LICENSE) | Basic libraries | `base` | +| **`ghc-prim`** | [`0.11.0`](http://hackage.haskell.org/package/ghc-prim-0.11.0) | [`BSD-3-Clause`](http://hackage.haskell.org/package/ghc-prim-0.11.0/src/LICENSE) | GHC primitives | *(core library)* | +| `hashable` | [`1.5.0.0`](http://hackage.haskell.org/package/hashable-1.5.0.0) | [`BSD-3-Clause`](http://hackage.haskell.org/package/hashable-1.5.0.0/src/LICENSE) | A class for types that can be converted to a hash value | `constraints` | +| **`mtl`** | [`2.3.1`](http://hackage.haskell.org/package/mtl-2.3.1) | [`BSD-3-Clause`](http://hackage.haskell.org/package/mtl-2.3.1/src/LICENSE) | Monad classes for transformers, using functional dependencies | `constraints`, `exceptions` | +| **`os-string`** | [`2.0.2`](http://hackage.haskell.org/package/os-string-2.0.2) | [`BSD-3-Clause`](http://hackage.haskell.org/package/os-string-2.0.2/src/LICENSE) | Library for manipulating Operating system strings. | `filepath`, `hashable` | +| **`pretty`** | [`1.1.3.6`](http://hackage.haskell.org/package/pretty-1.1.3.6) | [`BSD-3-Clause`](http://hackage.haskell.org/package/pretty-1.1.3.6/src/LICENSE) | Pretty-printing library | `template-haskell` | +| **`stm`** | [`2.5.3.1`](http://hackage.haskell.org/package/stm-2.5.3.1) | [`BSD-3-Clause`](http://hackage.haskell.org/package/stm-2.5.3.1/src/LICENSE) | Software Transactional Memory | `exceptions` | +| `tagged` | [`0.8.8`](http://hackage.haskell.org/package/tagged-0.8.8) | [`BSD-3-Clause`](http://hackage.haskell.org/package/tagged-0.8.8/src/LICENSE) | Haskell 98 phantom types to avoid unsafely passing dummy arguments | `boring` | +| **`template-haskell`** | [`2.22.0.0`](http://hackage.haskell.org/package/template-haskell-2.22.0.0) | [`BSD-3-Clause`](http://hackage.haskell.org/package/template-haskell-2.22.0.0/src/LICENSE) | Support library for Template Haskell | `bytestring`, `containers`, `exceptions`, `filepath`, `os-string`, `tagged`, `text` | +| **`text`** | [`2.1.1`](http://hackage.haskell.org/package/text-2.1.1) | [`BSD-2-Clause`](http://hackage.haskell.org/package/text-2.1.1/src/LICENSE) | An efficient packed Unicode text type. | `hashable` | +| **`transformers`** | [`0.6.1.1`](http://hackage.haskell.org/package/transformers-0.6.1.1) | [`BSD-3-Clause`](http://hackage.haskell.org/package/transformers-0.6.1.1/src/LICENSE) | Concrete functor and monad transformers | `boring`, `constraints`, `exceptions`, `mtl`, `tagged` | + diff --git a/base/haskerwaul-base.cabal b/base/haskerwaul-base.cabal index 72a87c2..fc00ab0 100644 --- a/base/haskerwaul-base.cabal +++ b/base/haskerwaul-base.cabal @@ -3,7 +3,9 @@ cabal-version: 3.0 name: haskerwaul-base version: 0.1.0.0 synopsis: ??? -description: ??? +description: Provides a parallel implementation of ‘base’, using definitions + from Haskerwaul, to improve compatibility. This is intended to help + port existing code, and shouldn’t be used for new code. author: Greg Pfeil maintainer: Greg Pfeil copyright: 2020–2024 Greg Pfeil @@ -14,24 +16,26 @@ build-type: Custom license: AGPL-3.0-or-later license-files: LICENSE -extra-source-files: +extra-doc-files: + CHANGELOG.md README.md + docs/*.md tested-with: GHC == { --- GHCup Nixpkgs 8.6.1, - 8.8.1, 8.8.4, + 8.8.1, 8.10.1, 8.10.7, - 9.0.1, 9.0.2, - 9.2.1, 9.2.8, - 9.4.1, 9.4.8, - 9.6.1, 9.6.2, - 9.8.1 + 9.0.1, 9.0.2, + 9.2.1, 9.2.5, + 9.4.1, 9.4.5, + 9.6.1, 9.6.3, + 9.8.1, + 9.10.1 } source-repository head type: git - location: git@github.com:sellout/haskerwaul.git + location: https://github.com/sellout/haskerwaul -- This mimics the GHC2021 extension -- (https://ghc.gitlab.haskell.org/ghc/doc/users_guide/exts/control.html?highlight=doandifthenelse#extension-GHC2021), @@ -91,7 +95,7 @@ flag noisy-deprecations common defaults import: GHC2021 build-depends: - base ^>= {4.12.0, 4.13.0, 4.14.0, 4.15.0, 4.16.0, 4.17.0, 4.18.0, 4.19.0}, + base ^>= {4.12.0, 4.13.0, 4.14.0, 4.15.0, 4.16.0, 4.17.0, 4.18.0, 4.19.0, 4.20.0}, ghc-options: -Weverything -- Type inference good. @@ -144,6 +148,7 @@ common defaults NoImplicitPrelude NoMonomorphismRestriction NoPatternGuards + NoStarIsType NoTypeApplications if flag(noisy-deprecations) cpp-options: -DSELLOUT_NOISY_DEPRECATIONS @@ -152,7 +157,7 @@ custom-setup setup-depends: -- TODO: Remove `Cabal` dep once haskell/cabal#3751 is fixed. Cabal ^>= {3.0.0, 3.2.0, 3.4.0, 3.6.0, 3.8.0, 3.10.0}, - base ^>= {4.12.0, 4.13.0, 4.14.0, 4.15.0, 4.16.0, 4.17.0, 4.18.0, 4.19.0}, + base ^>= {4.12.0, 4.13.0, 4.14.0, 4.15.0, 4.16.0, 4.17.0, 4.18.0, 4.19.0, 4.20.0}, cabal-doctest ^>= {1.0.0}, library @@ -174,8 +179,14 @@ test-suite doctests hs-source-dirs: tests main-is: doctests.hs build-depends: - doctest ^>= {0.16.0, 0.18.1, 0.20.1, 0.21.1, 0.22.2}, + doctest ^>= {0.16.0, 0.17.0, 0.18.0, 0.19.0, 0.20.0, 0.21.0, 0.22.0}, haskerwaul-base, + if impl(ghc >= 8.10.1) + ghc-options: + -- `doctest` requires the package containing the doctests as a dependency + -- to ensure it gets built before this test-suite, even though the package + -- appears to be unused. + -Wno-unused-packages -- TODO: The sections below here are necessary because we don’t have control -- over the generated `Build_doctests.hs` file. So we have to silence -- all of its warnings one way or another. diff --git a/flake.lock b/flake.lock index af237bd..7620a69 100644 --- a/flake.lock +++ b/flake.lock @@ -2,22 +2,29 @@ "nodes": { "bash-strict-mode": { "inputs": { - "flake-utils": "flake-utils_2", + "flake-utils": [ + "flaky", + "bash-strict-mode", + "flaky", + "flake-utils" + ], "flaky": [ "flaky" ], "nixpkgs": [ + "flaky", + "bash-strict-mode", "flaky", "nixpkgs" ], "shellcheck-nix-attributes": "shellcheck-nix-attributes" }, "locked": { - "lastModified": 1708982039, - "narHash": "sha256-pkgP6JLnnfFwo7qxVeM4BAqUYjg/HSQ1VfBohygyre4=", + "lastModified": 1722346313, + "narHash": "sha256-qxIzt/0BCP9LlVE1Lze/2qlM5eZ8X5hQk4E6ghiBF5w=", "owner": "sellout", "repo": "bash-strict-mode", - "rev": "9966778c963654ed911dc2f3b079be92cbd6880d", + "rev": "098ffd0f072b3b7b3e84d9c524d18d6c62f64a47", "type": "github" }, "original": { @@ -26,50 +33,6 @@ "type": "github" } }, - "concat": { - "inputs": { - "bash-strict-mode": [ - "flaky", - "bash-strict-mode" - ], - "flake-utils": [ - "flake-utils" - ], - "home-manager": "home-manager", - "nixpkgs": [ - "nixpkgs" - ] - }, - "locked": { - "lastModified": 1709117943, - "narHash": "sha256-3LXt0nQBSsEOe9h6j4gbSEf9vyjmTRN2xq4k8Emu7/8=", - "owner": "compiling-to-categories", - "repo": "concat", - "rev": "7aa7d5ebe165161b7c0aafb8af006020534eaf70", - "type": "github" - }, - "original": { - "owner": "compiling-to-categories", - "repo": "concat", - "type": "github" - } - }, - "flake-compat": { - "flake": false, - "locked": { - "lastModified": 1673956053, - "narHash": "sha256-4gtG9iQuiKITOjNQQeQIpoIB6b16fm+504Ch3sNKLd8=", - "owner": "edolstra", - "repo": "flake-compat", - "rev": "35bb57c0c8d8b62bbfd284272c928ceb64ddbde9", - "type": "github" - }, - "original": { - "owner": "edolstra", - "repo": "flake-compat", - "type": "github" - } - }, "flake-schemas": { "locked": { "lastModified": 1701189173, @@ -104,42 +67,20 @@ "type": "github" } }, - "flake-utils_2": { - "inputs": { - "systems": "systems_2" - }, - "locked": { - "lastModified": 1705309234, - "narHash": "sha256-uNRRNRKmJyCRC/8y1RqBkqWBLM034y4qN7EprSdmgyA=", - "owner": "numtide", - "repo": "flake-utils", - "rev": "1ef2e671c3b0c19053962c07dbda38332dcebf26", - "type": "github" - }, - "original": { - "owner": "numtide", - "repo": "flake-utils", - "type": "github" - } - }, "flaky": { "inputs": { "bash-strict-mode": "bash-strict-mode", - "flake-utils": [ - "flake-utils" - ], - "home-manager": "home-manager_2", - "nixpkgs": [ - "nixpkgs" - ], + "flake-utils": "flake-utils", + "home-manager": "home-manager", + "nixpkgs": "nixpkgs", "project-manager": "project-manager" }, "locked": { - "lastModified": 1714201379, - "narHash": "sha256-T0Jc6s2ObViZtB2p6GEknpXbUDKrslaUz7HTgUE4hgc=", + "lastModified": 1725261627, + "narHash": "sha256-+N5lzfkt4p23SSRZJAbeWnoG4zNMbcR7vQksotUUaUQ=", "owner": "sellout", "repo": "flaky", - "rev": "3f1b2a419ef7ff0ca778e25cb74eb98897d07c6f", + "rev": "3e3550e66d4b769cf3110fb6853326a45cdf7364", "type": "github" }, "original": { @@ -148,29 +89,42 @@ "type": "github" } }, - "home-manager": { + "flaky-haskell": { "inputs": { + "bash-strict-mode": [ + "flaky-haskell", + "flaky", + "bash-strict-mode" + ], + "flake-utils": [ + "flaky-haskell", + "flaky", + "flake-utils" + ], + "flaky": [ + "flaky" + ], "nixpkgs": [ - "concat", + "flaky-haskell", + "flaky", "nixpkgs" ] }, "locked": { - "lastModified": 1700814205, - "narHash": "sha256-lWqDPKHRbQfi+zNIivf031BUeyciVOtwCwTjyrhDB5g=", - "owner": "nix-community", - "repo": "home-manager", - "rev": "aeb2232d7a32530d3448318790534d196bf9427a", + "lastModified": 1722819603, + "narHash": "sha256-STW0DFNFmuZ+IrAghcUzi//f6K05ijtWIYyDfazlGX4=", + "owner": "sellout", + "repo": "flaky-haskell", + "rev": "45f4c21f38cb4a0d6665509301eee9e374b110f9", "type": "github" }, "original": { - "owner": "nix-community", - "ref": "release-23.11", - "repo": "home-manager", + "owner": "sellout", + "repo": "flaky-haskell", "type": "github" } }, - "home-manager_2": { + "home-manager": { "inputs": { "nixpkgs": [ "flaky", @@ -178,79 +132,32 @@ ] }, "locked": { - "lastModified": 1706981411, - "narHash": "sha256-cLbLPTL1CDmETVh4p0nQtvoF+FSEjsnJTFpTxhXywhQ=", + "lastModified": 1720042825, + "narHash": "sha256-A0vrUB6x82/jvf17qPCpxaM+ulJnD8YZwH9Ci0BsAzE=", "owner": "nix-community", "repo": "home-manager", - "rev": "652fda4ca6dafeb090943422c34ae9145787af37", + "rev": "e1391fb22e18a36f57e6999c7a9f966dc80ac073", "type": "github" }, "original": { "owner": "nix-community", - "ref": "release-23.11", + "ref": "release-24.05", "repo": "home-manager", "type": "github" } }, - "lowdown-src": { - "flake": false, - "locked": { - "lastModified": 1633514407, - "narHash": "sha256-Dw32tiMjdK9t3ETl5fzGrutQTzh2rufgZV4A/BbxuD4=", - "owner": "kristapsdz", - "repo": "lowdown", - "rev": "d2c2b44ff6c27b936ec27358a2653caaef8f73b8", - "type": "github" - }, - "original": { - "owner": "kristapsdz", - "repo": "lowdown", - "type": "github" - } - }, - "nix-schema": { - "inputs": { - "flake-compat": "flake-compat", - "flake-schemas": [ - "flaky", - "project-manager", - "flake-schemas" - ], - "lowdown-src": "lowdown-src", - "nixpkgs": [ - "flaky", - "project-manager", - "nixpkgs-23_11" - ], - "nixpkgs-regression": "nixpkgs-regression" - }, - "locked": { - "lastModified": 1697822067, - "narHash": "sha256-7HCcrF6GqIAreKvzt74do1/Urvp+b901Hckf5+WgR9M=", - "owner": "DeterminateSystems", - "repo": "nix", - "rev": "84867fa212fe08feeb27b668c4c78bc9eaf74e17", - "type": "github" - }, - "original": { - "owner": "DeterminateSystems", - "ref": "flake-schemas", - "repo": "nix", - "type": "github" - } - }, "nixpkgs": { "locked": { - "lastModified": 1718548739, - "narHash": "sha256-SCKSTpxrFG/z0ymKcGgZk5Z2sBARNlJzmG/JI7v8ntg=", + "lastModified": 1724013388, + "narHash": "sha256-vAq+I0IWsIDq5RUc01t25iL46LLxdsmlTJ96A30bMEY=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "eb04fca4de8d2f6e170a7ff3279ca47a37cced1c", + "rev": "3f38e71a8e23a27569acbbfee0e83b76c86fa569", "type": "github" }, "original": { "owner": "NixOS", - "ref": "release-23.11", + "ref": "release-24.05", "repo": "nixpkgs", "type": "github" } @@ -273,11 +180,11 @@ }, "nixpkgs-23_05": { "locked": { - "lastModified": 1705033721, - "narHash": "sha256-K5eJHmL1/kev6WuqyqqbS1cdNnSidIZ3jeqJ7GbrYnQ=", + "lastModified": 1705957679, + "narHash": "sha256-Q8LJaVZGJ9wo33wBafvZSzapYsjOaNjP/pOnSiKVGHY=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "a1982c92d8980a0114372973cbdfe0a307f1bdea", + "rev": "9a333eaa80901efe01df07eade2c16d183761fa3", "type": "github" }, "original": { @@ -289,11 +196,11 @@ }, "nixpkgs-23_11": { "locked": { - "lastModified": 1705886116, - "narHash": "sha256-xFSqFs9H5p2tNN2WWa6oFV4JQJHGqX2n9P+18XLeKDw=", + "lastModified": 1720535198, + "narHash": "sha256-zwVvxrdIzralnSbcpghA92tWu2DV2lwv89xZc8MTrbg=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "ad0bacf627106fe08900ef0e8e28c0685f2d8ac1", + "rev": "205fd4226592cc83fd4c0885a3e4c9c400efabb5", "type": "github" }, "original": { @@ -303,29 +210,13 @@ "type": "github" } }, - "nixpkgs-regression": { - "locked": { - "lastModified": 1643052045, - "narHash": "sha256-uGJ0VXIhWKGXxkeNnq4TvV3CIOkUJ3PAoLZ3HMzNVMw=", - "owner": "NixOS", - "repo": "nixpkgs", - "rev": "215d4d0fd80ca5163643b03a33fde804a29cc1e2", - "type": "github" - }, - "original": { - "owner": "NixOS", - "repo": "nixpkgs", - "rev": "215d4d0fd80ca5163643b03a33fde804a29cc1e2", - "type": "github" - } - }, "nixpkgs-unstable": { "locked": { - "lastModified": 1705697961, - "narHash": "sha256-XepT3WS516evSFYkme3GrcI3+7uwXHqtHbip+t24J7E=", + "lastModified": 1722141560, + "narHash": "sha256-Ul3rIdesWaiW56PS/Ak3UlJdkwBrD4UcagCmXZR9Z7Y=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "e5d1c87f5813afde2dda384ac807c57a105721cc", + "rev": "038fb464fcfa79b4f08131b07f2d8c9a6bcc4160", "type": "github" }, "original": { @@ -338,18 +229,27 @@ "project-manager": { "inputs": { "bash-strict-mode": [ + "flaky", + "project-manager", "flaky", "bash-strict-mode" ], "flake-schemas": "flake-schemas", "flake-utils": [ + "flaky", + "project-manager", "flaky", "flake-utils" ], "flaky": [ "flaky" ], - "nix-schema": "nix-schema", + "nixpkgs": [ + "flaky", + "project-manager", + "flaky", + "nixpkgs" + ], "nixpkgs-22_11": "nixpkgs-22_11", "nixpkgs-23_05": "nixpkgs-23_05", "nixpkgs-23_11": "nixpkgs-23_11", @@ -357,11 +257,11 @@ "treefmt-nix": "treefmt-nix" }, "locked": { - "lastModified": 1707028979, - "narHash": "sha256-Vo/7F1zMEWy62ChY7nXcvJf1pv5dm5jASdFJvPfy1pw=", + "lastModified": 1723360458, + "narHash": "sha256-l+junhIWTsYvVVFp/0YYfFPmTxODWJ2IoHesIvly4FQ=", "owner": "sellout", "repo": "project-manager", - "rev": "495cb847eb2cbf6b7981576c3b1610cc077c4768", + "rev": "342359f930e23ff26a6ccdace93089f4a7fff00c", "type": "github" }, "original": { @@ -372,10 +272,16 @@ }, "root": { "inputs": { - "concat": "concat", - "flake-utils": "flake-utils", + "flake-utils": [ + "flaky", + "flake-utils" + ], "flaky": "flaky", - "nixpkgs": "nixpkgs" + "flaky-haskell": "flaky-haskell", + "nixpkgs": [ + "flaky", + "nixpkgs" + ] } }, "shellcheck-nix-attributes": { @@ -409,35 +315,20 @@ "type": "github" } }, - "systems_2": { - "locked": { - "lastModified": 1681028828, - "narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=", - "owner": "nix-systems", - "repo": "default", - "rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e", - "type": "github" - }, - "original": { - "owner": "nix-systems", - "repo": "default", - "type": "github" - } - }, "treefmt-nix": { "inputs": { "nixpkgs": [ "flaky", "project-manager", - "nixpkgs-23_11" + "nixpkgs" ] }, "locked": { - "lastModified": 1705659004, - "narHash": "sha256-XQsZudrb9u5Pw631U0tFYZkjq49CcwF24XT01vz2jPk=", + "lastModified": 1722330636, + "narHash": "sha256-uru7JzOa33YlSRwf9sfXpJG+UAV+bnBEYMjrzKrQZFw=", "owner": "numtide", "repo": "treefmt-nix", - "rev": "8cd95da6c30852adb2a06c4b6bdacfe8b64a0a35", + "rev": "768acdb06968e53aa1ee8de207fd955335c754b7", "type": "github" }, "original": { diff --git a/flake.nix b/flake.nix index 04aa8bd..be2fe98 100644 --- a/flake.nix +++ b/flake.nix @@ -30,9 +30,9 @@ ### }; ### checks.format = verify that code matches Ormolu expectations outputs = { - concat, flake-utils, flaky, + flaky-haskell, nixpkgs, self, }: let @@ -41,7 +41,7 @@ supportedSystems = flaky.lib.defaultSystems; cabalPackages = pkgs: hpkgs: - concat.lib.cabalProject2nix + flaky-haskell.lib.cabalProject2nix ./cabal.project pkgs hpkgs @@ -69,119 +69,64 @@ # - NixOS/nixpkgs#26561 # - https://discourse.nixos.org/t/nix-haskell-development-2020/6170 overlays = { - default = - concat.lib.overlayHaskellPackages - (self.lib.supportedGhcVersions "") + default = final: prev: + flaky-haskell.lib.overlayHaskellPackages + (map self.lib.nixifyGhcVersion + (self.lib.supportedGhcVersions final.system)) (final: prev: nixpkgs.lib.composeManyExtensions [ ## TODO: I think this overlay is only needed by formatters, ## devShells, etc., so it shouldn’t be included in the ## standard overlay. - (flaky.overlays.haskell-dependencies final prev) + (flaky.overlays.haskellDependencies final prev) (self.overlays.haskell final prev) (self.overlays.haskellDependencies final prev) - ]); + ]) + final + prev; - haskell = concat.lib.haskellOverlay cabalPackages; + haskell = flaky-haskell.lib.haskellOverlay cabalPackages; - haskellDependencies = final: prev: hfinal: hprev: - { - constraints = hfinal.constraints_0_14; - constraints-extras = - final.haskell.lib.doJailbreak hprev.constraints-extras; - } - // ( - if nixpkgs.lib.versionAtLeast hprev.ghc.version "9.8.0" - then let - hspecVersion = "2_11_7"; - in { - ## The default versions in Nixpkgs 23.11 don’t support GHC 9.8. - doctest = hfinal.doctest_0_22_2; - hedgehog = hfinal."hedgehog_1_4"; - hedgehog-fn = final.haskell.lib.doJailbreak hprev.hedgehog-fn; - hspec = hfinal."hspec_${hspecVersion}"; - hspec-core = hfinal."hspec-core_${hspecVersion}"; - hspec-discover = hfinal."hspec-discover_${hspecVersion}"; - hspec-meta = hfinal."hspec-meta_${hspecVersion}"; - semigroupoids = hfinal.semigroupoids_6_0_0_1; - tagged = hfinal.tagged_0_8_8; - th-abstraction = hfinal.th-abstraction_0_6_0_0; - ## `Control.Monad.Trans.List` is gone with GHC 9.8, but - ## `lifted-base` hasn’t updated its tests to avoid it. - lifted-base = final.haskell.lib.dontCheck hprev.lifted-base; - ## The default versions in Nixpkgs 23.11 don’t support - ## th-abstraction 0.6. - aeson = final.haskell.lib.doJailbreak hprev.aeson; - bifunctors = hfinal.bifunctors_5_6_1; - free = hfinal.free_5_2; - } - ## TODO: The failures that led to this are inconsistent, but - ## persistent. - else if nixpkgs.lib.versionAtLeast hprev.ghc.version "9.6.0" - then { - ormolu = hfinal.ormolu_0_7_2_0; - streaming-commons = - final.haskell.lib.dontCheck hprev.streaming-commons; - } - else if nixpkgs.lib.versionAtLeast hprev.ghc.version "8.10.0" - then {} - else - { - ## NB: Fails a single test case under GHC 8.8.4. - doctest = final.haskell.lib.dontCheck hprev.doctest; - ## NB: Tests fail to build under GHC 8.8.4. - vector = final.haskell.lib.dontCheck hprev.vector; - } - // ( - if final.system == "i686-linux" - then { - ## NB: Fails `prop_double_assoc` under GHC 8.8.4 on i686-linux. - QuickCheck = final.haskell.lib.dontCheck hprev.QuickCheck; - } - else {} - ) - ); + ## NB: Dependencies that are overridden because they are broken in + ## Nixpkgs should be pushed upstream to Flaky. This is for + ## dependencies that we override for reasons local to the project. + haskellDependencies = final: prev: hfinal: hprev: {}; }; homeConfigurations = builtins.listToAttrs (builtins.map - (flaky.lib.homeConfigurations.example - pname - self - [ - ({pkgs, ...}: { - home.packages = [ - (pkgs.haskellPackages.ghcWithPackages (hpkgs: [ - hpkgs.${pname} - ])) - ]; - }) - ]) + (flaky.lib.homeConfigurations.example self [ + ({pkgs, ...}: { + home.packages = [ + (pkgs.haskellPackages.ghcWithPackages (hpkgs: [hpkgs.${pname}])) + ]; + }) + ]) supportedSystems); lib = { + nixifyGhcVersion = version: "ghc" + nixpkgs.lib.replaceStrings ["."] [""] version; + ## TODO: Extract this automatically from `pkgs.haskellPackages`. - defaultCompiler = "ghc948"; + defaultGhcVersion = "9.6.5"; ## Test the oldest revision possible for each minor release. If it’s not ## available in nixpkgs, test the oldest available, then try an older ## one via GitHub workflow. Additionally, check any revisions that have ## explicit conditionalization. And check whatever version `pkgs.ghc` ## maps to in the nixpkgs we depend on. - testedGhcVersions = system: - [ - self.lib.defaultCompiler - "ghc8107" - "ghc902" - "ghc924" - "ghc942" - "ghc962" - "ghc981" - # "ghcHEAD" # doctest doesn’t work on current HEAD - ] - ## dependency compiler-rt-libc-7.1.0 is broken in on aarch64-darwin. - ++ nixpkgs.lib.optional (system != "aarch64-darwin") "ghc884"; + testedGhcVersions = system: [ + self.lib.defaultGhcVersion + "8.10.7" + "9.0.2" + "9.2.5" + "9.4.5" + "9.6.3" + "9.8.1" + "9.10.1" + # "ghcHEAD" # doctest doesn’t work on current HEAD + ]; ## The versions that are older than those supported by Nix that we ## prefer to test against. @@ -195,7 +140,9 @@ "9.2.1" "9.4.1" "9.6.1" - "9.8.1" # since `cabal-plan-bounds` doesn’t work under Nix + ## since `cabal-plan-bounds` doesn’t work under Nix + "9.8.1" + "9.10.1" ]; ## However, provide packages in the default overlay for _every_ @@ -203,16 +150,15 @@ supportedGhcVersions = system: self.lib.testedGhcVersions system ++ [ - "ghc925" - "ghc926" - "ghc927" - "ghc928" - "ghc943" - "ghc944" - "ghc945" - "ghc946" - "ghc947" - "ghc963" + "9.2.6" + "9.2.7" + "9.2.8" + "9.4.6" + "9.4.7" + "9.4.8" + "9.6.4" + "9.6.5" + "9.8.2" ]; }; } @@ -229,27 +175,39 @@ }; in { packages = - {default = self.packages.${system}."${self.lib.defaultCompiler}_all";} - // concat.lib.mkPackages + { + default = + self.packages.${system}."${self.lib.nixifyGhcVersion self.lib.defaultGhcVersion}_all"; + } + // flaky-haskell.lib.mkPackages pkgs - (self.lib.supportedGhcVersions system) + (map self.lib.nixifyGhcVersion (self.lib.supportedGhcVersions system)) cabalPackages; devShells = - {default = self.devShells.${system}.${self.lib.defaultCompiler};} - // concat.lib.mkDevShells + { + default = + self.devShells.${system}.${self.lib.nixifyGhcVersion self.lib.defaultGhcVersion}; + } + // flaky-haskell.lib.mkDevShells pkgs - (self.lib.supportedGhcVersions system) + (map self.lib.nixifyGhcVersion (self.lib.supportedGhcVersions system)) cabalPackages (hpkgs: [self.projectConfigurations.${system}.packages.path] + ## NB: Haskell Language Server no longer supports GHC <9.2, and 9.4 + ## has an issue with it on i686-linux. + ## TODO: Remove the restriction on GHC 9.10 once + ## https://github.com/NixOS/nixpkgs/commit/e87381d634cb1ddd2bd7e121c44fbc926a8c026a + ## finds its way into 24.05. ++ nixpkgs.lib.optional - ( ## NB: Haskell Language Server no longer supports GHC <9. - nixpkgs.lib.versionAtLeast hpkgs.ghc.version "9" - ## TODO: HLS also apparently broken on 9.8.1 - && builtins.compareVersions hpkgs.ghc.version "9.8.1" != 0 - ## TODO: Also HLS seems to have a few problems on i686-linux. - && system != "i686-linux" + ( + ( + if system == "i686-linux" + then nixpkgs.lib.versionAtLeast hpkgs.ghc.version "9.4" + else nixpkgs.lib.versionAtLeast hpkgs.ghc.version "9.2" + ) + && nixpkgs.lib.versionOlder hpkgs.ghc.version "9.10" ) hpkgs.haskell-language-server); @@ -261,28 +219,15 @@ }); inputs = { - # Currently contains our Haskell/Nix lib that should be extracted into its - # own flake. - concat = { - inputs = { - ## TODO: The version currently used by concat doesn’t support i686-linux. - bash-strict-mode.follows = "flaky/bash-strict-mode"; - flake-utils.follows = "flake-utils"; - nixpkgs.follows = "nixpkgs"; - }; - url = "github:compiling-to-categories/concat"; - }; + ## Flaky should generally be the source of truth for its inputs. + flaky.url = "github:sellout/flaky"; - flake-utils.url = "github:numtide/flake-utils"; + flake-utils.follows = "flaky/flake-utils"; + nixpkgs.follows = "flaky/nixpkgs"; - flaky = { - inputs = { - flake-utils.follows = "flake-utils"; - nixpkgs.follows = "nixpkgs"; - }; - url = "github:sellout/flaky"; + flaky-haskell = { + inputs.flaky.follows = "flaky"; + url = "github:sellout/flaky-haskell"; }; - - nixpkgs.url = "github:NixOS/nixpkgs/release-23.11"; }; } diff --git a/garnix.yaml b/garnix.yaml index 71f13b1..bc209ef 100644 --- a/garnix.yaml +++ b/garnix.yaml @@ -1,2 +1,2 @@ # This file was generated by Project Manager. -{"builds":{"exclude":["*.x86_64-darwin","*.x86_64-darwin.*","homeConfigurations.x86_64-darwin-haskerwaul-example","devShells.*.lax-checks"],"include":["homeConfigurations.*","nixosConfigurations.*","checks.aarch64-darwin.*","devShells.aarch64-darwin.default","packages.aarch64-darwin.default","devShells.aarch64-darwin.ghc948","packages.aarch64-darwin.ghc948_all","devShells.aarch64-darwin.ghc8107","packages.aarch64-darwin.ghc8107_all","devShells.aarch64-darwin.ghc902","packages.aarch64-darwin.ghc902_all","devShells.aarch64-darwin.ghc924","packages.aarch64-darwin.ghc924_all","devShells.aarch64-darwin.ghc942","packages.aarch64-darwin.ghc942_all","devShells.aarch64-darwin.ghc962","packages.aarch64-darwin.ghc962_all","devShells.aarch64-darwin.ghc981","packages.aarch64-darwin.ghc981_all","checks.aarch64-linux.*","devShells.aarch64-linux.default","packages.aarch64-linux.default","devShells.aarch64-linux.ghc948","packages.aarch64-linux.ghc948_all","devShells.aarch64-linux.ghc8107","packages.aarch64-linux.ghc8107_all","devShells.aarch64-linux.ghc902","packages.aarch64-linux.ghc902_all","devShells.aarch64-linux.ghc924","packages.aarch64-linux.ghc924_all","devShells.aarch64-linux.ghc942","packages.aarch64-linux.ghc942_all","devShells.aarch64-linux.ghc962","packages.aarch64-linux.ghc962_all","devShells.aarch64-linux.ghc981","packages.aarch64-linux.ghc981_all","devShells.aarch64-linux.ghc884","packages.aarch64-linux.ghc884_all","checks.i686-linux.*","devShells.i686-linux.default","packages.i686-linux.default","devShells.i686-linux.ghc948","packages.i686-linux.ghc948_all","devShells.i686-linux.ghc8107","packages.i686-linux.ghc8107_all","devShells.i686-linux.ghc902","packages.i686-linux.ghc902_all","devShells.i686-linux.ghc924","packages.i686-linux.ghc924_all","devShells.i686-linux.ghc942","packages.i686-linux.ghc942_all","devShells.i686-linux.ghc962","packages.i686-linux.ghc962_all","devShells.i686-linux.ghc981","packages.i686-linux.ghc981_all","devShells.i686-linux.ghc884","packages.i686-linux.ghc884_all","checks.x86_64-linux.*","devShells.x86_64-linux.default","packages.x86_64-linux.default","devShells.x86_64-linux.ghc948","packages.x86_64-linux.ghc948_all","devShells.x86_64-linux.ghc8107","packages.x86_64-linux.ghc8107_all","devShells.x86_64-linux.ghc902","packages.x86_64-linux.ghc902_all","devShells.x86_64-linux.ghc924","packages.x86_64-linux.ghc924_all","devShells.x86_64-linux.ghc942","packages.x86_64-linux.ghc942_all","devShells.x86_64-linux.ghc962","packages.x86_64-linux.ghc962_all","devShells.x86_64-linux.ghc981","packages.x86_64-linux.ghc981_all","devShells.x86_64-linux.ghc884","packages.x86_64-linux.ghc884_all"]}} \ No newline at end of file +{"builds":{"exclude":["*.x86_64-darwin","*.x86_64-darwin.*","homeConfigurations.x86_64-darwin-example","devShells.*.lax-checks"],"include":["homeConfigurations.*","nixosConfigurations.*","checks.aarch64-darwin.*","devShells.aarch64-darwin.default","packages.aarch64-darwin.default","devShells.aarch64-darwin.ghc965","packages.aarch64-darwin.ghc965_all","devShells.aarch64-darwin.ghc8107","packages.aarch64-darwin.ghc8107_all","devShells.aarch64-darwin.ghc902","packages.aarch64-darwin.ghc902_all","devShells.aarch64-darwin.ghc925","packages.aarch64-darwin.ghc925_all","devShells.aarch64-darwin.ghc945","packages.aarch64-darwin.ghc945_all","devShells.aarch64-darwin.ghc963","packages.aarch64-darwin.ghc963_all","devShells.aarch64-darwin.ghc981","packages.aarch64-darwin.ghc981_all","devShells.aarch64-darwin.ghc9101","packages.aarch64-darwin.ghc9101_all","checks.aarch64-linux.*","devShells.aarch64-linux.default","packages.aarch64-linux.default","devShells.aarch64-linux.ghc965","packages.aarch64-linux.ghc965_all","devShells.aarch64-linux.ghc8107","packages.aarch64-linux.ghc8107_all","devShells.aarch64-linux.ghc902","packages.aarch64-linux.ghc902_all","devShells.aarch64-linux.ghc925","packages.aarch64-linux.ghc925_all","devShells.aarch64-linux.ghc945","packages.aarch64-linux.ghc945_all","devShells.aarch64-linux.ghc963","packages.aarch64-linux.ghc963_all","devShells.aarch64-linux.ghc981","packages.aarch64-linux.ghc981_all","devShells.aarch64-linux.ghc9101","packages.aarch64-linux.ghc9101_all","checks.x86_64-linux.*","devShells.x86_64-linux.default","packages.x86_64-linux.default","devShells.x86_64-linux.ghc965","packages.x86_64-linux.ghc965_all","devShells.x86_64-linux.ghc8107","packages.x86_64-linux.ghc8107_all","devShells.x86_64-linux.ghc902","packages.x86_64-linux.ghc902_all","devShells.x86_64-linux.ghc925","packages.x86_64-linux.ghc925_all","devShells.x86_64-linux.ghc945","packages.x86_64-linux.ghc945_all","devShells.x86_64-linux.ghc963","packages.x86_64-linux.ghc963_all","devShells.x86_64-linux.ghc981","packages.x86_64-linux.ghc981_all","devShells.x86_64-linux.ghc9101","packages.x86_64-linux.ghc9101_all","checks.i686-linux.*","devShells.i686-linux.default","packages.i686-linux.default","devShells.i686-linux.ghc965","packages.i686-linux.ghc965_all","devShells.i686-linux.ghc8107","packages.i686-linux.ghc8107_all","devShells.i686-linux.ghc902","packages.i686-linux.ghc902_all","devShells.i686-linux.ghc925","packages.i686-linux.ghc925_all","devShells.i686-linux.ghc945","packages.i686-linux.ghc945_all","devShells.i686-linux.ghc963","packages.i686-linux.ghc963_all","devShells.i686-linux.ghc981","packages.i686-linux.ghc981_all","devShells.i686-linux.ghc9101","packages.i686-linux.ghc9101_all"]}} \ No newline at end of file diff --git a/haskerwaul/CHANGELOG.md b/haskerwaul/CHANGELOG.md new file mode 100644 index 0000000..a7bec31 --- /dev/null +++ b/haskerwaul/CHANGELOG.md @@ -0,0 +1,12 @@ +# Changelog + +All notable changes to this project will be documented in this file. + +The format is based on [Keep a Changelog 1.1](https://keepachangelog.com/en/1.1.0/), +and this project adheres to the [Haskell Package Versioning Policy](https://pvp.haskell.org/). + +## [0.1.0.0] - 2024-08-28 + +### Added + +- initial release of this package diff --git a/haskerwaul/README.md b/haskerwaul/README.md new file mode 100644 index 0000000..eb59943 --- /dev/null +++ b/haskerwaul/README.md @@ -0,0 +1,297 @@ +# Haskerwaul + +[![Packaging status](https://repology.org/badge/tiny-repos/haskell:haskerwaul.svg)](https://repology.org/project/haskell:haskerwaul/versions) +[![latest packaged versions](https://repology.org/badge/latest-versions/haskell:haskerwaul.svg)](https://repology.org/project/haskell:haskerwaul/versions) + +Category-parametric programming + +## overview + +This library gives an extremely abstract presentation of various CT and abstract algebra concepts. + +The structure is largely based on [nLab](https://ncatlab.org/nlab/show/HomePage), with some additional references to [Wikipedia](https://www.wikipedia.org/). I've tried to link to as many pages as possible throughout the library to make it easy to understand all the concepts (or, at least as easy as getting your head around category theory is likely to be). + +## usage + +This library attempts to play well with the existing type classes in base. For example, we promote instances from base with instances like this: + +```haskell +instance + {-# OVERLAPPABLE #-} + (Data.Functor.Functor f) => + Haskerwaul.Functor.Functor (->) (->) f + where + map = Data.Functor.fmap +``` + +Which also means that if you're defining your own instances, you'd be well-served to implement them using the type classes from base whenever possible, getting a bunch of Haskerwaul instances for free (for example, if you implement `Control.Category.Category`, I think you must get at least three separate Haskerwaul instances ([`Magma`](./src/Haskerwaul/Magma.hs), [`Semigroup`](./src/Haskerwaul/Semigroup.hs), and [`UnitalMagma`](./src/Haskerwaul/Magma/Unital.hs) -- things like [`Semicategory`](./src/Haskerwaul/Semicategory.hs) and [`Category`](./src/Haskerwaul/Category.hs) are either type synonyms or have universal instances already defined. Once you have the instance from base, you can implement richer classes like `CartesianClosedCategory` using Haskerwaul's classes. + +However, this library doesn’t play well with `Prelude`, co-opting a bunch of the same names, so it's helpful to either enable `NoImplicitPrelude` or import Haskerwaul qualified. Unfortunately, [the `Haskerwaul` module](./src/Haskerwaul.hs) isn’t quite a custom Prelude and I've avoided expanding it into one, because there are a lot of points of contention when designing a Prelude. But perhaps it can be used as the basis of one. + +### varieties of categories + +- **Set**/**Hask** -- `(->)` +- `Constraint` -- `(:-)` +- [`Functor`](./src/Haskerwaul/Functor.hs) categories (including `Constraint`- + valued functors +- [`Bifunctor`](./src/Haskerwaul/Bifunctor.hs) categories (separate from functor + categories because we don't yet have real product categories) +- [`Opposite`](./src/Haskerwaul/Category/Opposite.hs) categories +- [`FullSubcategory`s](./src/Haskerwaul/Subcategory/Full.hs) by adding arbitrary + constraints, filtering the objects in the category +- [`Kleisli`](./src/Haskerwaul/Category/Kleisli.hs) (and + [`CoKleisli`](./src/Haskerwaul/Category/CoKleisli.hs)) categories over + arbitrary categories +- [`ClosedCategory`s](./src/Haskerwaul/Category/Closed.hs) (beyond **Set**, and + even beyond ones that have objects of kind `Type`) + +## naming conventions + +### types and classes + +The names we use generally come from [nLab](https://ncatlab.org/nlab/show/HomePage), and I've tried to include links into nLab as much as possible in the Haddock. + +### type parameters + +There are a lot of one-character type parameters here, but we try to use them at least somewhat consistently. + +- `ok` – _kinds_ of the objects in a category +- `ob` – _constraints_ on the objects in a category +- `c`, `c'`, `d` – categories representing the arrows of the category (kind `ok -> ok -> Type`) +- `a`, `b`, `x`, `y`, `z` – objects in a category and/or elements of those objects (kind `ok`) +- `t`, `t'`, `ct`, `dt` – tensors (kind `ok -> ok -> ok`) in a category (`ct` and `dt` distinguish when we're talking about tensors in categories `c` and `d`) + +## [horizontal categorification](https://ncatlab.org/nlab/show/horizontal+categorification) / oidification + +Horizontally categorified concepts are generally defined via type synonyms. +For example, the most central concept in this library is `Category`, which is defined +simply as + +```haskell +type Category = HorizontalCategorification Monoid +``` + +See [the +examples](https://ncatlab.org/nlab/show/horizontal+categorification#examples) +for a more comprehensive list. + +In cases where we can't simply use type synonyms, the Haddock should describe +why. + +## law checking + +Haskerwaul attempts to make it as easy and flexible as possible to test laws +using whatever mechanism you already use in your projects. We do this by +breaking things into relatively small pieces. + +- Individual laws are defined under `Haskerwaul.Law` and should be minimally + constrained, taking the required morphisms as arguments. These build a `Law` + structure, which is basically just a tuple of morphisms that should commute. +- Aggregate laws for a structure are defined in + `Haskerwaul..Laws`. These should accumulate all the laws for their + substructures as well. + +The former are defined as abstractly as possible (for example, you can often define a +law for an arbitrary `MonoidalCategory`), while the latter currently require at +least an `ElementaryTopos` to get the characteristic morphism. However, +as you can see in `Haskerwaul.Semigroup.Laws` the laws can still be checked +against tensors other than the Cartesian product. + +To test these laws, you need an `ElementaryTopos` for your testing +library. There is one for [Hedgehog](https://hedgehog.qa/) included. This then +lets you map each structure's laws into your topos, so you can test your own +instances. Since the structure laws are cumulative, this means you don't need +tests for `Magma _ _ Foo`, `UnitalMagma _ _ Foo`, etc. You should be able to do +a single test of `Group _ _ Foo`. + +**NB**: One shortcoming is that since the structures are cumulative, and there +are often shared sub-structures in the tree, we currently end up testing the +more basic laws multiple times for a richer structure. It would be good to build +up the laws without duplication. + +## what to work on + +There are various patterns that indicate something can be improved. + +### `__TODO__` or `__FIXME__` + +These are the usual labels in comments to indicate that there is more work to be done on something. (The double-underscore on either side indicates to [Haddock](https://www.haskell.org/haddock/) that it should be bold when included in documentation.) + +### `~ (->)`, `~ (,)`, `~ All` + +Patterns like these are used when an instance has to be over-constrained. This +way we still get to use the type parameters we want in the instance declaration +and also have a way to `grep` for cases that are overconstrained, while arriving +at something that works in the mean time. + +### newtypes + +Newtypes are commonly used to workaround the "uniqueness" of instances. However, +aside from the other issues that we won't get into here, the fact that newtypes +are restricted to **Hask** means that we’re often overconstrained as a +result (see `~ (->)` above). + +So, we try to avoid newtypes as much as possible. In `base`, you see things like + +```haskell +newtype Ap f a = Ap { getAp :: f a } +instance (Applicative f, Monoid a) => Monoid (Ap f a) where + ... +``` + +but that forces `f :: k -> Type` (granted, `Applicative` already forces +`f :: Type -> Type`, so it's no loss in `base`). However, we want to stay more +kind-polymorphic, so we take a different tradeoff and write stuff like + +```haskell +instance (LaxMonoidalFunctor c ct d dt f, Monoid c ct a) => Monoid d dt (f a) +``` + +(where `LaxMonoidalFunctor` is our equivalent of `Applicative`), which means we +need `UndecidableInstances`, but it's worth it to be kind-polymorphic. + +### relations + +The way relations are currently implemented means that an `EqualityRelation` +_is_ a `PartialOrder`, and since these are defined with type classes, it means +the `PartialOrder` that’s richer than the discrete one implied by the +`EqualityRelation` needs to be made distinct via a newtype. And similarly, the +(unique) `EqualityRelation` also needs a newtype to make it distinct from the +`InequalityRelation` that it's derived from. +`nix build` will build and test the project fully. + +See "newtypes" above. + +### enriched categories + +In "plain" category theory, the Hom functor for a category **C** is a functor **C** x **C** -> **Set**. Enriched category theory generalizes that **Set** to some arbitrary monoidal category **V**. For example, in the case of preorders, **V** may be **Set** (where the image is only singleton sets and the empty set) or it can be **Bool**, which more precisely models the exists-or-not nature of the relationship. + +One way to model this is to add a parameter `v` to `Category c`, like + +```haskell +class Monoid (DinaturalTransformation v) Procompose c => Category v c +``` + +However, this means that the same category, enriched differently, has multiple instances. Modeling the enrichment separately, for example, + +```haskell +class (MonoidalCategory v, Category c) => EnrichedCategory v c +``` + +seems good, but the Hom functor is fundamental to the definition of composition in `c`. Finally, perhaps we can encode some "primary" **V** existentially, and model other enrichments via functors from **V**. + +### PolyKinds + +This library strives to take advantage of `PolyKinds`, which make it possible to say things like `Category ~ Monoid (NaturalTransformation (->)) Procompose`, however we use newtypes like `Additive` and `Multiplicative` to say things like `Semiring a ~ (Monoid (Additive a), Monoid (Multiplicative a))`, and since fully-applied type constructors need to have kind `Type` it means that `Semiring` _isn't_ kind-polymorphic. + +As a result, at various places in the code we find ourselves stuck dealing with `Type` when we'd like to remain polymorphic. Remedying this would be helpful. + +## licensing + +This package is licensed under [The GNU AGPL 3.0 or later](./LICENSE). If you need a license for usage that isn’t covered under the AGPL, please contact [Greg Pfeil](mailto:greg@technomadic.org?subject=licensing%20no-recursion). + +You should review the [license report](docs/license-report.md) for details about dependency licenses. + +## versioning + +This project largely follows the [Haskell Package Versioning Policy](https://pvp.haskell.org/) (PVP), but is more strict in some ways. + +The version always has four components, `A.B.C.D`. The first three correspond to those required by PVP, while the fourth matches the “patch” component from [Semantic Versioning](https://semver.org/). + +Here is a breakdown of some of the constraints: + +### sensitivity to additions to the API + +PVP recommends that clients follow [these import guidelines](https://wiki.haskell.org/Import_modules_properly) in order that they may be considered insensitive to additions to the API. However, this isn’t sufficient. We expect clients to follow these additional recommendations for API insensitivity + +If you don’t follow these recommendations (in addition to the ones made by PVP), you should ensure your dependencies don’t allow a range of `C` values. That is, your dependencies should look like + +```cabal +yaya >=1.2.3 && <1.2.4 +``` + +rather than + +```cabal +yaya >=1.2.3 && <1.3 +``` + +#### use package-qualified imports everywhere + +If your imports are [package-qualified](https://downloads.haskell.org/ghc/latest/docs/users_guide/exts/package_qualified_imports.html?highlight=packageimports#extension-PackageImports), then a dependency adding new modules can’t cause a conflict with modules you already import. + +#### avoid orphans + +Because of the transitivity of instances, orphans make you sensitive to your dependencies’ instances. If you have an orphan instance, you are sensitive to the APIs of the packages that define the class and the types of the instance. + +One way to minimize this sensitivity is to have a separate package (or packages) dedicated to any orphans you have. Those packages can be sensitive to their dependencies’ APIs, while the primary package remains insensitive, relying on the tighter ranges of the orphan packages to constrain the solver. + +### transitively breaking changes (increments `A`) + +#### removing a type class instance + +Type class instances are imported transitively, and thus changing them can impact packages that only have your package as a transitive dependency. + +#### widening a dependency range with new major versions + +This is a consequence of instances being transitively imported. A new major version of a dependency can remove instances, and that can break downstream clients that unwittingly depended on those instances. + +A library MAY declare that it always bumps the `A` component when it removes an instance (as this policy dictates). In that case, only `A` widenings need to induce `A` bumps. `B` widenings can be `D` bumps like other widenings, Alternatively, one may compare the APIs when widening a dependency range, and if no instances have been removed, make it a `D` bump. + +### breaking changes (increments `B`) + +#### restricting an existing dependency’s version range in any way + +Consumers have to contend not only with our version bounds, but also with those of other libraries. It’s possible that some dependency overlapped in a very narrow way, and even just restricting a particular patch version of a dependency could make it impossible to find a dependency solution. + +#### restricting the license in any way + +Making a license more restrictive may prevent clients from being able to continue using the package. + +#### adding a dependency + +A new dependency may make it impossible to find a solution in the face of other packages dependency ranges. + +### non-breaking changes (increments `C`) + +#### adding a module + +This is also what PVP recommends. However, unlike in PVP, this is because we recommend that package-qualified imports be used on all imports. + +### other changes (increments `D`) + +#### widening a dependency range for non-major versions + +This is fairly uncommon, in the face of `^>=`-style ranges, but it can happen in a few situations. + +#### deprecation + +**NB**: This case is _weaker_ than PVP, which indicates that packages should bump their major version when adding `deprecation` pragmas. + +We disagree with this because packages shouldn’t be _publishing_ with `-Werror`. The intent of deprecation is to indicate that some API _will_ change. To make that signal a major change itself defeats the purpose. You want people to start seeing that warning as soon as possible. The major change occurs when you actually remove the old API. + +Yes, in development, `-Werror` is often (and should be) used. However, that just helps developers be aware of deprecations more immediately. They can always add `-Wwarn=deprecation` in some scope if they need to avoid updating it for the time being. + +## comparisons + +There are a number of libraries that attempt to encode categories in various ways. I try to explain how Haskerwaul compares to each of them, to make it easier to decide what you want to use for your own project. I would be very happy to get additional input for this section from people who have used these other libraries (even if it's just to ask a question, like "how does Haskerwaul's approach to X compare to SubHask, which does Y?"). + +In general, Haskerwaul is much more fine-grained than other libraries. It also has many small modules with minimal dependencies between them. Haskerwaul is also not quite as ergonomic as other libraries in many situations. For example, `Magma`'s `op` is the least meaningful name possible and it occurs _everywhere_ in polymorphic functions, meaning anything from function composition to addition, meet, join, etc. And there are currently plenty of places where (thanks to `newtype`s) the category ends up constrained to `->`, which is a frustrating limitation. + +### [algebra](http://hackage.haskell.org/package/algebra) + +### [categories](http://hackage.haskell.org/package/categories) + +This adds a handful of the concepts defined in Haskerwaul, and those it includes are designed to be compatible with the existing `Category` type class in `base`. For example, the categories aren’t constrained. Haskerwaul's `Category` is generalized and fits into a much larger framework of categorical concepts. + +### [concat](https://github.com/conal/concat) + +The primary component of this is a compiler plugin for category-based rewriting. However, it needs a category hierarchy to perform the rewrites on, so it provides one of its own. The hierarchy is pretty small, restricts objects to kind `Type`, also has a single definition for products, coproducts, exponentials, etc., which reduces the flexibility a lot. Finally, concat has some naming conventions (and hierarchy) that perhaps better serves Haskell programmers understanding the mechanism than modeling categorical concepts. That is, it uses names like `NumCat`, which is a `Category`-polymorphic `Num` class rather than a name like `Ring` that ties it more to category theory (or at least abstract algebra). + +### [constrained-categories](https://hackage.haskell.org/package/constrained-categories) + +### [HaskellForMaths](http://hackage.haskell.org/package/HaskellForMaths) + +### [SubHask](http://hackage.haskell.org/package/subhask) + +SubHask uses a similar mechanism for subcategories, an associated type family (`ValidCategory` as opposed to `Ob`) to add constraints to operations. But it doesn't generalize across kinds (for example, a `Category` isn't a `Monoid`). It also doesn't allow categories to be monoidal in multiple ways, as the tensor is existential. diff --git a/haskerwaul/Setup.hs b/haskerwaul/Setup.hs index aee59ef..4d53144 100644 --- a/haskerwaul/Setup.hs +++ b/haskerwaul/Setup.hs @@ -1,12 +1,17 @@ -- __NB__: `custom-setup` doesn’t have any way to specify extensions or options, -- so any we want need to be specified here. +{-# LANGUAGE CPP #-} {-# LANGUAGE PackageImports #-} {-# LANGUAGE Unsafe #-} {-# LANGUAGE NoImplicitPrelude #-} +#if MIN_VERSION_GLASGOW_HASKELL(8, 0, 0, 0) {-# OPTIONS_GHC -Weverything #-} -- Warns even when `Unsafe` is explicit, not inferred. See -- https://gitlab.haskell.org/ghc/ghc/-/issues/16689 {-# OPTIONS_GHC -Wno-unsafe #-} +#else +{-# OPTIONS_GHC -Wall #-} +#endif module Main (main) where diff --git a/haskerwaul/docs/license-report.md b/haskerwaul/docs/license-report.md new file mode 100644 index 0000000..ad6be0f --- /dev/null +++ b/haskerwaul/docs/license-report.md @@ -0,0 +1,39 @@ +**NB**: This captures the licenses associated with a particular set of dependency versions. If your own build solves differently, it’s possible that the licenses may have changed, or even that the set of dependencies itself is different. Please make sure you run [`cabal-plan license-report`](https://hackage.haskell.org/package/cabal-plan) on your own components rather than assuming this is authoritative. + +# Dependency License Report + +Bold-faced **`package-name`**s denote standard libraries bundled with `ghc-9.10.1`. + +## Direct dependencies of `haskerwaul:lib:haskerwaul` + +| Name | Version | [SPDX](https://spdx.org/licenses/) License Id | Description | Also depended upon by | +| --- | --- | --- | --- | --- | +| **`base`** | [`4.20.0.0`](http://hackage.haskell.org/package/base-4.20.0.0) | [`BSD-3-Clause`](http://hackage.haskell.org/package/base-4.20.0.0/src/LICENSE) | Core data structures and operations | *(core library)* | +| `constraints` | [`0.14.2`](http://hackage.haskell.org/package/constraints-0.14.2) | [`BSD-2-Clause`](http://hackage.haskell.org/package/constraints-0.14.2/src/LICENSE) | Constraint manipulation | | +| **`containers`** | [`0.7`](http://hackage.haskell.org/package/containers-0.7) | [`BSD-3-Clause`](http://hackage.haskell.org/package/containers-0.7/src/LICENSE) | Assorted concrete container types | `binary`, `hashable` | + +## Indirect transitive dependencies + +| Name | Version | [SPDX](https://spdx.org/licenses/) License Id | Description | Depended upon by | +| --- | --- | --- | --- | --- | +| **`array`** | [`0.5.7.0`](http://hackage.haskell.org/package/array-0.5.7.0) | [`BSD-3-Clause`](http://hackage.haskell.org/package/array-0.5.7.0/src/LICENSE) | Mutable and immutable arrays | `binary`, `containers`, `deepseq`, `stm`, `text` | +| **`binary`** | [`0.8.9.2`](http://hackage.haskell.org/package/binary-0.8.9.2) | [`BSD-3-Clause`](http://hackage.haskell.org/package/binary-0.8.9.2/src/LICENSE) | Binary serialisation for Haskell values using lazy ByteStrings | `constraints`, `text` | +| `boring` | [`0.2.2`](http://hackage.haskell.org/package/boring-0.2.2) | [`BSD-3-Clause`](http://hackage.haskell.org/package/boring-0.2.2/src/LICENSE) | Boring and Absurd types | `constraints` | +| **`bytestring`** | [`0.12.1.0`](http://hackage.haskell.org/package/bytestring-0.12.1.0) | [`BSD-3-Clause`](http://hackage.haskell.org/package/bytestring-0.12.1.0/src/LICENSE) | Fast, compact, strict and lazy byte strings with a list interface | `binary`, `filepath`, `hashable`, `os-string`, `text` | +| **`deepseq`** | [`1.5.0.0`](http://hackage.haskell.org/package/deepseq-1.5.0.0) | [`BSD-3-Clause`](http://hackage.haskell.org/package/deepseq-1.5.0.0/src/LICENSE) | Deep evaluation of data structures | `bytestring`, `constraints`, `containers`, `filepath`, `hashable`, `os-string`, `pretty`, `tagged`, `text` | +| **`exceptions`** | [`0.10.7`](http://hackage.haskell.org/package/exceptions-0.10.7) | [`BSD-3-Clause`](http://hackage.haskell.org/package/exceptions-0.10.7/src/LICENSE) | Extensible optionally-pure exceptions | `filepath`, `os-string` | +| **`filepath`** | [`1.5.2.0`](http://hackage.haskell.org/package/filepath-1.5.2.0) | [`BSD-3-Clause`](http://hackage.haskell.org/package/filepath-1.5.2.0/src/LICENSE) | Library for manipulating FilePaths in a cross platform way. | `hashable` | +| **`ghc-bignum`** | [`1.3`](http://hackage.haskell.org/package/ghc-bignum-1.3) | [`BSD-3-Clause`](http://hackage.haskell.org/package/ghc-bignum-1.3/src/LICENSE) | GHC BigNum library | `ghc-internal`, `hashable` | +| **`ghc-boot-th`** | [`9.10.1`](http://hackage.haskell.org/package/ghc-boot-th-9.10.1) | [`BSD-3-Clause`](http://hackage.haskell.org/package/ghc-boot-th-9.10.1/src/LICENSE) | Shared functionality between GHC and the @template-haskell@ library | `template-haskell` | +| **`ghc-internal`** | [`9.1001.0`](http://hackage.haskell.org/package/ghc-internal-9.1001.0) | [`BSD-3-Clause`](http://hackage.haskell.org/package/ghc-internal-9.1001.0/src/LICENSE) | Basic libraries | `base` | +| **`ghc-prim`** | [`0.11.0`](http://hackage.haskell.org/package/ghc-prim-0.11.0) | [`BSD-3-Clause`](http://hackage.haskell.org/package/ghc-prim-0.11.0/src/LICENSE) | GHC primitives | *(core library)* | +| `hashable` | [`1.5.0.0`](http://hackage.haskell.org/package/hashable-1.5.0.0) | [`BSD-3-Clause`](http://hackage.haskell.org/package/hashable-1.5.0.0/src/LICENSE) | A class for types that can be converted to a hash value | `constraints` | +| **`mtl`** | [`2.3.1`](http://hackage.haskell.org/package/mtl-2.3.1) | [`BSD-3-Clause`](http://hackage.haskell.org/package/mtl-2.3.1/src/LICENSE) | Monad classes for transformers, using functional dependencies | `constraints`, `exceptions` | +| **`os-string`** | [`2.0.2`](http://hackage.haskell.org/package/os-string-2.0.2) | [`BSD-3-Clause`](http://hackage.haskell.org/package/os-string-2.0.2/src/LICENSE) | Library for manipulating Operating system strings. | `filepath`, `hashable` | +| **`pretty`** | [`1.1.3.6`](http://hackage.haskell.org/package/pretty-1.1.3.6) | [`BSD-3-Clause`](http://hackage.haskell.org/package/pretty-1.1.3.6/src/LICENSE) | Pretty-printing library | `template-haskell` | +| **`stm`** | [`2.5.3.1`](http://hackage.haskell.org/package/stm-2.5.3.1) | [`BSD-3-Clause`](http://hackage.haskell.org/package/stm-2.5.3.1/src/LICENSE) | Software Transactional Memory | `exceptions` | +| `tagged` | [`0.8.8`](http://hackage.haskell.org/package/tagged-0.8.8) | [`BSD-3-Clause`](http://hackage.haskell.org/package/tagged-0.8.8/src/LICENSE) | Haskell 98 phantom types to avoid unsafely passing dummy arguments | `boring` | +| **`template-haskell`** | [`2.22.0.0`](http://hackage.haskell.org/package/template-haskell-2.22.0.0) | [`BSD-3-Clause`](http://hackage.haskell.org/package/template-haskell-2.22.0.0/src/LICENSE) | Support library for Template Haskell | `bytestring`, `containers`, `exceptions`, `filepath`, `os-string`, `tagged`, `text` | +| **`text`** | [`2.1.1`](http://hackage.haskell.org/package/text-2.1.1) | [`BSD-2-Clause`](http://hackage.haskell.org/package/text-2.1.1/src/LICENSE) | An efficient packed Unicode text type. | `hashable` | +| **`transformers`** | [`0.6.1.1`](http://hackage.haskell.org/package/transformers-0.6.1.1) | [`BSD-3-Clause`](http://hackage.haskell.org/package/transformers-0.6.1.1/src/LICENSE) | Concrete functor and monad transformers | `boring`, `constraints`, `exceptions`, `mtl`, `tagged` | + diff --git a/haskerwaul/haskerwaul.cabal b/haskerwaul/haskerwaul.cabal index d2f2df8..b7f2efd 100644 --- a/haskerwaul/haskerwaul.cabal +++ b/haskerwaul/haskerwaul.cabal @@ -15,28 +15,26 @@ build-type: Custom license: AGPL-3.0-or-later license-files: LICENSE -extra-source-files: +extra-doc-files: + CHANGELOG.md README.md + docs/*.md tested-with: GHC == { --- GHCup Nixpkgs - 7.10.3, - 8.0.1, - 8.2.1, - 8.4.1, 8.6.1, - 8.8.1, 8.8.4, + 8.8.1, 8.10.1, 8.10.7, - 9.0.1, 9.0.2, - 9.2.1, 9.2.8, - 9.4.1, 9.4.8, - 9.6.1, 9.6.2, - 9.8.1 + 9.0.1, 9.0.2, + 9.2.1, 9.2.5, + 9.4.1, 9.4.5, + 9.6.1, 9.6.3, + 9.8.1, + 9.10.1 } source-repository head type: git - location: git@github.com:sellout/haskerwaul.git + location: https://github.com/sellout/haskerwaul -- This mimics the GHC2021 extension -- (https://ghc.gitlab.haskell.org/ghc/doc/users_guide/exts/control.html?highlight=doandifthenelse#extension-GHC2021), @@ -96,7 +94,7 @@ flag noisy-deprecations common defaults import: GHC2021 build-depends: - base ^>= {4.12.0, 4.13.0, 4.14.0, 4.15.0, 4.16.0, 4.17.0, 4.18.0, 4.19.0}, + base ^>= {4.12.0, 4.13.0, 4.14.0, 4.15.0, 4.16.0, 4.17.0, 4.18.0, 4.19.0, 4.20.0}, ghc-options: -Weverything -- Type inference good. @@ -149,6 +147,7 @@ common defaults NoImplicitPrelude NoMonomorphismRestriction NoPatternGuards + NoStarIsType NoTypeApplications if flag(noisy-deprecations) cpp-options: -DSELLOUT_NOISY_DEPRECATIONS @@ -157,7 +156,7 @@ custom-setup setup-depends: -- TODO: Remove `Cabal` dep once haskell/cabal#3751 is fixed. Cabal ^>= {3.0.0, 3.2.0, 3.4.0, 3.6.0, 3.8.0, 3.10.0}, - base ^>= {4.12.0, 4.13.0, 4.14.0, 4.15.0, 4.16.0, 4.17.0, 4.18.0, 4.19.0}, + base ^>= {4.12.0, 4.13.0, 4.14.0, 4.15.0, 4.16.0, 4.17.0, 4.18.0, 4.19.0, 4.20.0}, cabal-doctest ^>= {1.0.0}, library @@ -165,7 +164,7 @@ library build-depends: -- NB: constraints 0.14 adds an internal hom and a Cartesian product constraints ^>= {0.14}, - containers ^>= {0.6.0}, + containers ^>= {0.6.0, 0.7}, hs-source-dirs: src ghc-options: @@ -476,8 +475,14 @@ test-suite doctests hs-source-dirs: tests main-is: doctests.hs build-depends: - doctest ^>= {0.16.0, 0.18.1, 0.20.1, 0.21.1, 0.22.2}, + doctest ^>= {0.16.0, 0.17.0, 0.18.0, 0.19.0, 0.20.0, 0.21.0, 0.22.0}, haskerwaul, + if impl(ghc >= 8.10.1) + ghc-options: + -- `doctest` requires the package containing the doctests as a dependency + -- to ensure it gets built before this test-suite, even though the package + -- appears to be unused. + -Wno-unused-packages -- TODO: The sections below here are necessary because we don’t have control -- over the generated `Build_doctests.hs` file. So we have to silence -- all of its warnings one way or another. diff --git a/hedgehog/CHANGELOG.md b/hedgehog/CHANGELOG.md new file mode 100644 index 0000000..a7bec31 --- /dev/null +++ b/hedgehog/CHANGELOG.md @@ -0,0 +1,12 @@ +# Changelog + +All notable changes to this project will be documented in this file. + +The format is based on [Keep a Changelog 1.1](https://keepachangelog.com/en/1.1.0/), +and this project adheres to the [Haskell Package Versioning Policy](https://pvp.haskell.org/). + +## [0.1.0.0] - 2024-08-28 + +### Added + +- initial release of this package diff --git a/hedgehog/README.md b/hedgehog/README.md new file mode 100644 index 0000000..324c574 --- /dev/null +++ b/hedgehog/README.md @@ -0,0 +1,94 @@ +# Haskerwaul’s Hedgehog integration + +[![Packaging status](https://repology.org/badge/tiny-repos/haskell:haskerwaul-hedgehog.svg)](https://repology.org/project/haskell:haskerwaul-hedgehog/versions) +[![latest packaged versions](https://repology.org/badge/latest-versions/haskell:haskerwaul-hedgehog.svg)](https://repology.org/project/haskell:haskerwaul-hedgehog/versions) + +## usage + +If you use Haskerwaul, this package can help you write tests fairly abstractly. It implements an `ElementaryTopos` for Hedgehog, which can then be used to test various properties. + +## licensing + +This package is licensed under [The GNU AGPL 3.0 or later](./LICENSE). If you need a license for usage that isn’t covered under the AGPL, please contact [Greg Pfeil](mailto:greg@technomadic.org?subject=licensing%20no-recursion). + +You should review the [license report](docs/license-report.md) for details about dependency licenses. + +## versioning + +This project largely follows the [Haskell Package Versioning Policy](https://pvp.haskell.org/) (PVP), but is more strict in some ways. + +The version always has four components, `A.B.C.D`. The first three correspond to those required by PVP, while the fourth matches the “patch” component from [Semantic Versioning](https://semver.org/). + +Here is a breakdown of some of the constraints: + +### sensitivity to additions to the API + +PVP recommends that clients follow [these import guidelines](https://wiki.haskell.org/Import_modules_properly) in order that they may be considered insensitive to additions to the API. However, this isn’t sufficient. We expect clients to follow these additional recommendations for API insensitivity + +If you don’t follow these recommendations (in addition to the ones made by PVP), you should ensure your dependencies don’t allow a range of `C` values. That is, your dependencies should look like + +```cabal +yaya >=1.2.3 && <1.2.4 +``` + +rather than + +```cabal +yaya >=1.2.3 && <1.3 +``` + +#### use package-qualified imports everywhere + +If your imports are [package-qualified](https://downloads.haskell.org/ghc/latest/docs/users_guide/exts/package_qualified_imports.html?highlight=packageimports#extension-PackageImports), then a dependency adding new modules can’t cause a conflict with modules you already import. + +#### avoid orphans + +Because of the transitivity of instances, orphans make you sensitive to your dependencies’ instances. If you have an orphan instance, you are sensitive to the APIs of the packages that define the class and the types of the instance. + +One way to minimize this sensitivity is to have a separate package (or packages) dedicated to any orphans you have. Those packages can be sensitive to their dependencies’ APIs, while the primary package remains insensitive, relying on the tighter ranges of the orphan packages to constrain the solver. + +### transitively breaking changes (increments `A`) + +#### removing a type class instance + +Type class instances are imported transitively, and thus changing them can impact packages that only have your package as a transitive dependency. + +#### widening a dependency range with new major versions + +This is a consequence of instances being transitively imported. A new major version of a dependency can remove instances, and that can break downstream clients that unwittingly depended on those instances. + +A library MAY declare that it always bumps the `A` component when it removes an instance (as this policy dictates). In that case, only `A` widenings need to induce `A` bumps. `B` widenings can be `D` bumps like other widenings, Alternatively, one may compare the APIs when widening a dependency range, and if no instances have been removed, make it a `D` bump. + +### breaking changes (increments `B`) + +#### restricting an existing dependency’s version range in any way + +Consumers have to contend not only with our version bounds, but also with those of other libraries. It’s possible that some dependency overlapped in a very narrow way, and even just restricting a particular patch version of a dependency could make it impossible to find a dependency solution. + +#### restricting the license in any way + +Making a license more restrictive may prevent clients from being able to continue using the package. + +#### adding a dependency + +A new dependency may make it impossible to find a solution in the face of other packages dependency ranges. + +### non-breaking changes (increments `C`) + +#### adding a module + +This is also what PVP recommends. However, unlike in PVP, this is because we recommend that package-qualified imports be used on all imports. + +### other changes (increments `D`) + +#### widening a dependency range for non-major versions + +This is fairly uncommon, in the face of `^>=`-style ranges, but it can happen in a few situations. + +#### deprecation + +**NB**: This case is _weaker_ than PVP, which indicates that packages should bump their major version when adding `deprecation` pragmas. + +We disagree with this because packages shouldn’t be _publishing_ with `-Werror`. The intent of deprecation is to indicate that some API _will_ change. To make that signal a major change itself defeats the purpose. You want people to start seeing that warning as soon as possible. The major change occurs when you actually remove the old API. + +Yes, in development, `-Werror` is often (and should be) used. However, that just helps developers be aware of deprecations more immediately. They can always add `-Wwarn=deprecation` in some scope if they need to avoid updating it for the time being. diff --git a/hedgehog/Setup.hs b/hedgehog/Setup.hs index aee59ef..4d53144 100644 --- a/hedgehog/Setup.hs +++ b/hedgehog/Setup.hs @@ -1,12 +1,17 @@ -- __NB__: `custom-setup` doesn’t have any way to specify extensions or options, -- so any we want need to be specified here. +{-# LANGUAGE CPP #-} {-# LANGUAGE PackageImports #-} {-# LANGUAGE Unsafe #-} {-# LANGUAGE NoImplicitPrelude #-} +#if MIN_VERSION_GLASGOW_HASKELL(8, 0, 0, 0) {-# OPTIONS_GHC -Weverything #-} -- Warns even when `Unsafe` is explicit, not inferred. See -- https://gitlab.haskell.org/ghc/ghc/-/issues/16689 {-# OPTIONS_GHC -Wno-unsafe #-} +#else +{-# OPTIONS_GHC -Wall #-} +#endif module Main (main) where diff --git a/hedgehog/docs/license-report.md b/hedgehog/docs/license-report.md new file mode 100644 index 0000000..b6f8bb7 --- /dev/null +++ b/hedgehog/docs/license-report.md @@ -0,0 +1,73 @@ +**NB**: This captures the licenses associated with a particular set of dependency versions. If your own build solves differently, it’s possible that the licenses may have changed, or even that the set of dependencies itself is different. Please make sure you run [`cabal-plan license-report`](https://hackage.haskell.org/package/cabal-plan) on your own components rather than assuming this is authoritative. + +# Dependency License Report + +Bold-faced **`package-name`**s denote standard libraries bundled with `ghc-9.10.1`. + +## Direct dependencies of `haskerwaul-hedgehog:lib:haskerwaul-hedgehog` + +| Name | Version | [SPDX](https://spdx.org/licenses/) License Id | Description | Also depended upon by | +| --- | --- | --- | --- | --- | +| **`base`** | [`4.20.0.0`](http://hackage.haskell.org/package/base-4.20.0.0) | [`BSD-3-Clause`](http://hackage.haskell.org/package/base-4.20.0.0/src/LICENSE) | Core data structures and operations | *(core library)* | +| `constraints` | [`0.14.2`](http://hackage.haskell.org/package/constraints-0.14.2) | [`BSD-2-Clause`](http://hackage.haskell.org/package/constraints-0.14.2/src/LICENSE) | Constraint manipulation | `haskerwaul`, `lifted-async` | +| `haskerwaul` | [`0.1.0.0`](http://hackage.haskell.org/package/haskerwaul-0.1.0.0) | *MISSING* | *MISSING* | | +| `hedgehog` | [`1.4`](http://hackage.haskell.org/package/hedgehog-1.4) | [`BSD-3-Clause`](http://hackage.haskell.org/package/hedgehog-1.4/src/LICENSE) | Release with confidence. | `hedgehog-fn` | +| `hedgehog-fn` | [`1.0`](http://hackage.haskell.org/package/hedgehog-fn-1.0) | [`BSD-3-Clause`](http://hackage.haskell.org/package/hedgehog-fn-1.0/src/LICENCE) | Function generation for `hedgehog` | | + +## Indirect transitive dependencies + +| Name | Version | [SPDX](https://spdx.org/licenses/) License Id | Description | Depended upon by | +| --- | --- | --- | --- | --- | +| `StateVar` | [`1.2.2`](http://hackage.haskell.org/package/StateVar-1.2.2) | [`BSD-3-Clause`](http://hackage.haskell.org/package/StateVar-1.2.2/src/LICENSE) | State variables | `contravariant` | +| `ansi-terminal` | [`1.1.1`](http://hackage.haskell.org/package/ansi-terminal-1.1.1) | [`BSD-3-Clause`](http://hackage.haskell.org/package/ansi-terminal-1.1.1/src/LICENSE) | Simple ANSI terminal support | `concurrent-output`, `hedgehog` | +| `ansi-terminal-types` | [`1.1`](http://hackage.haskell.org/package/ansi-terminal-types-1.1) | [`BSD-3-Clause`](http://hackage.haskell.org/package/ansi-terminal-types-1.1/src/LICENSE) | Types and functions used to represent SGR aspects | `ansi-terminal` | +| **`array`** | [`0.5.7.0`](http://hackage.haskell.org/package/array-0.5.7.0) | [`BSD-3-Clause`](http://hackage.haskell.org/package/array-0.5.7.0/src/LICENSE) | Mutable and immutable arrays | `binary`, `containers`, `deepseq`, `pretty-show`, `stm`, `text` | +| `async` | [`2.2.5`](http://hackage.haskell.org/package/async-2.2.5) | [`BSD-3-Clause`](http://hackage.haskell.org/package/async-2.2.5/src/LICENSE) | Run IO operations asynchronously and wait for their results | `concurrent-output`, `hedgehog`, `lifted-async` | +| `barbies` | [`2.1.1.0`](http://hackage.haskell.org/package/barbies-2.1.1.0) | [`BSD-3-Clause`](http://hackage.haskell.org/package/barbies-2.1.1.0/src/LICENSE) | Classes for working with types that can change clothes. | `hedgehog` | +| `base-orphans` | [`0.9.2`](http://hackage.haskell.org/package/base-orphans-0.9.2) | [`MIT`](http://hackage.haskell.org/package/base-orphans-0.9.2/src/LICENSE) | Backwards-compatible orphan instances for base | `distributive`, `transformers-base` | +| **`binary`** | [`0.8.9.2`](http://hackage.haskell.org/package/binary-0.8.9.2) | [`BSD-3-Clause`](http://hackage.haskell.org/package/binary-0.8.9.2/src/LICENSE) | Binary serialisation for Haskell values using lazy ByteStrings | `constraints`, `text` | +| `boring` | [`0.2.2`](http://hackage.haskell.org/package/boring-0.2.2) | [`BSD-3-Clause`](http://hackage.haskell.org/package/boring-0.2.2/src/LICENSE) | Boring and Absurd types | `constraints` | +| **`bytestring`** | [`0.12.1.0`](http://hackage.haskell.org/package/bytestring-0.12.1.0) | [`BSD-3-Clause`](http://hackage.haskell.org/package/bytestring-0.12.1.0/src/LICENSE) | Fast, compact, strict and lazy byte strings with a list interface | `binary`, `filepath`, `hashable`, `hedgehog`, `os-string`, `random`, `text`, `unix` | +| `colour` | [`2.3.6`](http://hackage.haskell.org/package/colour-2.3.6) | [`MIT`](http://hackage.haskell.org/package/colour-2.3.6/src/LICENSE) | A model for human colour/color perception | `ansi-terminal`, `ansi-terminal-types` | +| `concurrent-output` | [`1.10.21`](http://hackage.haskell.org/package/concurrent-output-1.10.21) | [`BSD-2-Clause`](http://hackage.haskell.org/package/concurrent-output-1.10.21/src/LICENSE) | Ungarble output from several threads or commands | `hedgehog` | +| **`containers`** | [`0.7`](http://hackage.haskell.org/package/containers-0.7) | [`BSD-3-Clause`](http://hackage.haskell.org/package/containers-0.7/src/LICENSE) | Assorted concrete container types | `binary`, `hashable`, `haskerwaul`, `hedgehog`, `resourcet`, `wl-pprint-annotated` | +| `contravariant` | [`1.5.5`](http://hackage.haskell.org/package/contravariant-1.5.5) | [`BSD-3-Clause`](http://hackage.haskell.org/package/contravariant-1.5.5/src/LICENSE) | Contravariant functors | `hedgehog-fn` | +| **`deepseq`** | [`1.5.0.0`](http://hackage.haskell.org/package/deepseq-1.5.0.0) | [`BSD-3-Clause`](http://hackage.haskell.org/package/deepseq-1.5.0.0/src/LICENSE) | Deep evaluation of data structures | `bytestring`, `constraints`, `containers`, `filepath`, `hashable`, `hedgehog`, `os-string`, `pretty`, `primitive`, `process`, `random`, `safe-exceptions`, `splitmix`, `tagged`, `text`, `time`, `wl-pprint-annotated` | +| **`directory`** | [`1.3.8.3`](http://hackage.haskell.org/package/directory-1.3.8.3) | [`BSD-3-Clause`](http://hackage.haskell.org/package/directory-1.3.8.3/src/LICENSE) | Platform-agnostic library for filesystem operations | `concurrent-output`, `hedgehog`, `process` | +| `distributive` | [`0.6.2.1`](http://hackage.haskell.org/package/distributive-0.6.2.1) | [`BSD-3-Clause`](http://hackage.haskell.org/package/distributive-0.6.2.1/src/LICENSE) | Distributive functors -- Dual to Traversable | `barbies` | +| `erf` | [`2.0.0.0`](http://hackage.haskell.org/package/erf-2.0.0.0) | [`BSD-3-Clause`](http://hackage.haskell.org/package/erf-2.0.0.0) | The error function, erf, and related functions. | `hedgehog` | +| **`exceptions`** | [`0.10.7`](http://hackage.haskell.org/package/exceptions-0.10.7) | [`BSD-3-Clause`](http://hackage.haskell.org/package/exceptions-0.10.7/src/LICENSE) | Extensible optionally-pure exceptions | `concurrent-output`, `filepath`, `hedgehog`, `os-string`, `resourcet`, `safe-exceptions` | +| **`filepath`** | [`1.5.2.0`](http://hackage.haskell.org/package/filepath-1.5.2.0) | [`BSD-3-Clause`](http://hackage.haskell.org/package/filepath-1.5.2.0/src/LICENSE) | Library for manipulating FilePaths in a cross platform way. | `directory`, `hashable`, `pretty-show`, `process`, `unix` | +| **`ghc-bignum`** | [`1.3`](http://hackage.haskell.org/package/ghc-bignum-1.3) | [`BSD-3-Clause`](http://hackage.haskell.org/package/ghc-bignum-1.3/src/LICENSE) | GHC BigNum library | `ghc-internal`, `hashable` | +| **`ghc-boot-th`** | [`9.10.1`](http://hackage.haskell.org/package/ghc-boot-th-9.10.1) | [`BSD-3-Clause`](http://hackage.haskell.org/package/ghc-boot-th-9.10.1/src/LICENSE) | Shared functionality between GHC and the @template-haskell@ library | `template-haskell` | +| **`ghc-internal`** | [`9.1001.0`](http://hackage.haskell.org/package/ghc-internal-9.1001.0) | [`BSD-3-Clause`](http://hackage.haskell.org/package/ghc-internal-9.1001.0/src/LICENSE) | Basic libraries | `base` | +| **`ghc-prim`** | [`0.11.0`](http://hackage.haskell.org/package/ghc-prim-0.11.0) | [`BSD-3-Clause`](http://hackage.haskell.org/package/ghc-prim-0.11.0/src/LICENSE) | GHC primitives | *(core library)* | +| `hashable` | [`1.5.0.0`](http://hackage.haskell.org/package/hashable-1.5.0.0) | [`BSD-3-Clause`](http://hackage.haskell.org/package/hashable-1.5.0.0/src/LICENSE) | A class for types that can be converted to a hash value | `async`, `constraints` | +| `haskell-lexer` | [`1.1.1`](http://hackage.haskell.org/package/haskell-lexer-1.1.1) | [`MIT`](http://hackage.haskell.org/package/haskell-lexer-1.1.1/src/LICENSE) | A fully compliant Haskell 98 lexer | `pretty-show` | +| `lifted-async` | [`0.10.2.5`](http://hackage.haskell.org/package/lifted-async-0.10.2.5) | [`BSD-3-Clause`](http://hackage.haskell.org/package/lifted-async-0.10.2.5/src/LICENSE) | Run lifted IO operations asynchronously and wait for their results | `hedgehog` | +| `lifted-base` | [`0.2.3.12`](http://hackage.haskell.org/package/lifted-base-0.2.3.12) | [`BSD-3-Clause`](http://hackage.haskell.org/package/lifted-base-0.2.3.12/src/LICENSE) | lifted IO operations from the base library | `lifted-async` | +| `mmorph` | [`1.2.0`](http://hackage.haskell.org/package/mmorph-1.2.0) | [`BSD-3-Clause`](http://hackage.haskell.org/package/mmorph-1.2.0/src/LICENSE) | Monad morphisms | `hedgehog` | +| `monad-control` | [`1.0.3.1`](http://hackage.haskell.org/package/monad-control-1.0.3.1) | [`BSD-3-Clause`](http://hackage.haskell.org/package/monad-control-1.0.3.1/src/LICENSE) | Lift control operations, like exception catching, through monad transformers | `hedgehog`, `lifted-async`, `lifted-base` | +| **`mtl`** | [`2.3.1`](http://hackage.haskell.org/package/mtl-2.3.1) | [`BSD-3-Clause`](http://hackage.haskell.org/package/mtl-2.3.1/src/LICENSE) | Monad classes for transformers, using functional dependencies | `constraints`, `exceptions`, `hedgehog`, `mmorph`, `random`, `resourcet` | +| **`os-string`** | [`2.0.2`](http://hackage.haskell.org/package/os-string-2.0.2) | [`BSD-3-Clause`](http://hackage.haskell.org/package/os-string-2.0.2/src/LICENSE) | Library for manipulating Operating system strings. | `directory`, `filepath`, `hashable`, `unix` | +| **`pretty`** | [`1.1.3.6`](http://hackage.haskell.org/package/pretty-1.1.3.6) | [`BSD-3-Clause`](http://hackage.haskell.org/package/pretty-1.1.3.6/src/LICENSE) | Pretty-printing library | `pretty-show`, `template-haskell` | +| `pretty-show` | [`1.10`](http://hackage.haskell.org/package/pretty-show-1.10) | [`MIT`](http://hackage.haskell.org/package/pretty-show-1.10/src/LICENSE) | Tools for working with derived `Show` instances and generic inspection of values. | `hedgehog` | +| `primitive` | [`0.9.0.0`](http://hackage.haskell.org/package/primitive-0.9.0.0) | [`BSD-3-Clause`](http://hackage.haskell.org/package/primitive-0.9.0.0/src/LICENSE) | Primitive memory-related operations | `hedgehog`, `resourcet` | +| **`process`** | [`1.6.19.0`](http://hackage.haskell.org/package/process-1.6.19.0) | [`BSD-3-Clause`](http://hackage.haskell.org/package/process-1.6.19.0/src/LICENSE) | Process libraries | `concurrent-output` | +| `random` | [`1.2.1.2`](http://hackage.haskell.org/package/random-1.2.1.2) | [`BSD-3-Clause`](http://hackage.haskell.org/package/random-1.2.1.2/src/LICENSE) | Pseudo-random number generation | `hedgehog` | +| `resourcet` | [`1.3.0`](http://hackage.haskell.org/package/resourcet-1.3.0) | [`BSD-3-Clause`](http://hackage.haskell.org/package/resourcet-1.3.0/src/LICENSE) | Deterministic allocation and freeing of scarce resources. | `hedgehog` | +| `safe-exceptions` | [`0.1.7.4`](http://hackage.haskell.org/package/safe-exceptions-0.1.7.4) | [`MIT`](http://hackage.haskell.org/package/safe-exceptions-0.1.7.4/src/LICENSE) | Safe, consistent, and easy exception handling | `hedgehog` | +| `splitmix` | [`0.1.0.5`](http://hackage.haskell.org/package/splitmix-0.1.0.5) | [`BSD-3-Clause`](http://hackage.haskell.org/package/splitmix-0.1.0.5/src/LICENSE) | Fast Splittable PRNG | `random` | +| **`stm`** | [`2.5.3.1`](http://hackage.haskell.org/package/stm-2.5.3.1) | [`BSD-3-Clause`](http://hackage.haskell.org/package/stm-2.5.3.1/src/LICENSE) | Software Transactional Memory | `StateVar`, `async`, `concurrent-output`, `exceptions`, `hedgehog`, `monad-control`, `transformers-base` | +| `tagged` | [`0.8.8`](http://hackage.haskell.org/package/tagged-0.8.8) | [`BSD-3-Clause`](http://hackage.haskell.org/package/tagged-0.8.8/src/LICENSE) | Haskell 98 phantom types to avoid unsafely passing dummy arguments | `boring`, `distributive` | +| **`template-haskell`** | [`2.22.0.0`](http://hackage.haskell.org/package/template-haskell-2.22.0.0) | [`BSD-3-Clause`](http://hackage.haskell.org/package/template-haskell-2.22.0.0/src/LICENSE) | Support library for Template Haskell | `bytestring`, `containers`, `exceptions`, `filepath`, `hedgehog`, `os-string`, `primitive`, `tagged`, `text` | +| `terminal-size` | [`0.3.4`](http://hackage.haskell.org/package/terminal-size-0.3.4) | [`BSD-3-Clause`](http://hackage.haskell.org/package/terminal-size-0.3.4/src/LICENSE) | Get terminal window height and width | `concurrent-output` | +| **`text`** | [`2.1.1`](http://hackage.haskell.org/package/text-2.1.1) | [`BSD-2-Clause`](http://hackage.haskell.org/package/text-2.1.1/src/LICENSE) | An efficient packed Unicode text type. | `concurrent-output`, `hashable`, `hedgehog`, `pretty-show`, `wl-pprint-annotated` | +| **`time`** | [`1.12.2`](http://hackage.haskell.org/package/time-1.12.2) | [`BSD-2-Clause`](http://hackage.haskell.org/package/time-1.12.2/src/LICENSE) | A time library | `directory`, `hedgehog`, `unix` | +| **`transformers`** | [`0.6.1.1`](http://hackage.haskell.org/package/transformers-0.6.1.1) | [`BSD-3-Clause`](http://hackage.haskell.org/package/transformers-0.6.1.1/src/LICENSE) | Concrete functor and monad transformers | `StateVar`, `barbies`, `boring`, `concurrent-output`, `constraints`, `contravariant`, `distributive`, `exceptions`, `hedgehog`, `hedgehog-fn`, `mmorph`, `monad-control`, `mtl`, `primitive`, `resourcet`, `safe-exceptions`, `tagged`, `transformers-base`, `transformers-compat`, `unliftio-core` | +| `transformers-base` | [`0.4.6`](http://hackage.haskell.org/package/transformers-base-0.4.6) | [`BSD-3-Clause`](http://hackage.haskell.org/package/transformers-base-0.4.6/src/LICENSE) | Lift computations from the bottom of a transformer stack | `hedgehog`, `lifted-async`, `lifted-base`, `monad-control` | +| `transformers-compat` | [`0.7.2`](http://hackage.haskell.org/package/transformers-compat-0.7.2) | [`BSD-3-Clause`](http://hackage.haskell.org/package/transformers-compat-0.7.2/src/LICENSE) | A small compatibility shim for the transformers library | `mmorph`, `monad-control`, `transformers-base` | +| **`unix`** | [`2.8.5.1`](http://hackage.haskell.org/package/unix-2.8.5.1) | [`BSD-3-Clause`](http://hackage.haskell.org/package/unix-2.8.5.1/src/LICENSE) | POSIX functionality | `concurrent-output`, `directory`, `process` | +| `unliftio-core` | [`0.2.1.0`](http://hackage.haskell.org/package/unliftio-core-0.2.1.0) | [`MIT`](http://hackage.haskell.org/package/unliftio-core-0.2.1.0/src/LICENSE) | The MonadUnliftIO typeclass for unlifting monads to IO | `resourcet` | +| `wl-pprint-annotated` | [`0.1.0.1`](http://hackage.haskell.org/package/wl-pprint-annotated-0.1.0.1) | [`BSD-3-Clause`](http://hackage.haskell.org/package/wl-pprint-annotated-0.1.0.1/src/LICENSE) | Pretty printer with annotation support | `hedgehog` | + diff --git a/hedgehog/haskerwaul-hedgehog.cabal b/hedgehog/haskerwaul-hedgehog.cabal index f77e73d..ae304e1 100644 --- a/hedgehog/haskerwaul-hedgehog.cabal +++ b/hedgehog/haskerwaul-hedgehog.cabal @@ -14,28 +14,26 @@ build-type: Custom license: AGPL-3.0-or-later license-files: LICENSE -extra-source-files: +extra-doc-files: + CHANGELOG.md README.md + docs/*.md tested-with: GHC == { --- GHCup Nixpkgs - 7.10.3, - 8.0.1, - 8.2.1, - 8.4.1, 8.6.1, - 8.8.1, 8.8.4, + 8.8.1, 8.10.1, 8.10.7, - 9.0.1, 9.0.2, - 9.2.1, 9.2.8, - 9.4.1, 9.4.8, - 9.6.1, 9.6.2, - 9.8.1 + 9.0.1, 9.0.2, + 9.2.1, 9.2.5, + 9.4.1, 9.4.5, + 9.6.1, 9.6.3, + 9.8.1, + 9.10.1 } source-repository head type: git - location: git@github.com:sellout/haskerwaul.git + location: https://github.com/sellout/haskerwaul -- This mimics the GHC2021 extension -- (https://ghc.gitlab.haskell.org/ghc/doc/users_guide/exts/control.html?highlight=doandifthenelse#extension-GHC2021), @@ -95,7 +93,7 @@ flag noisy-deprecations common defaults import: GHC2021 build-depends: - base ^>= {4.12.0, 4.13.0, 4.14.0, 4.15.0, 4.16.0, 4.17.0, 4.18.0, 4.19.0}, + base ^>= {4.12.0, 4.13.0, 4.14.0, 4.15.0, 4.16.0, 4.17.0, 4.18.0, 4.19.0, 4.20.0}, ghc-options: -Weverything -- Type inference good. @@ -148,6 +146,7 @@ common defaults NoImplicitPrelude NoMonomorphismRestriction NoPatternGuards + NoStarIsType NoTypeApplications if flag(noisy-deprecations) cpp-options: -DSELLOUT_NOISY_DEPRECATIONS @@ -156,7 +155,7 @@ custom-setup setup-depends: -- TODO: Remove `Cabal` dep once haskell/cabal#3751 is fixed. Cabal ^>= {3.0.0, 3.2.0, 3.4.0, 3.6.0, 3.8.0, 3.10.0}, - base ^>= {4.12.0, 4.13.0, 4.14.0, 4.15.0, 4.16.0, 4.17.0, 4.18.0, 4.19.0}, + base ^>= {4.12.0, 4.13.0, 4.14.0, 4.15.0, 4.16.0, 4.17.0, 4.18.0, 4.19.0, 4.20.0}, cabal-doctest ^>= {1.0.0}, library @@ -186,8 +185,14 @@ test-suite doctests hs-source-dirs: tests main-is: doctests.hs build-depends: - doctest ^>= {0.16.0, 0.18.1, 0.20.1, 0.21.1, 0.22.2}, + doctest ^>= {0.16.0, 0.17.0, 0.18.0, 0.19.0, 0.20.0, 0.21.0, 0.22.0}, haskerwaul-hedgehog, + if impl(ghc >= 8.10.1) + ghc-options: + -- `doctest` requires the package containing the doctests as a dependency + -- to ensure it gets built before this test-suite, even though the package + -- appears to be unused. + -Wno-unused-packages -- TODO: The sections below here are necessary because we don’t have control -- over the generated `Build_doctests.hs` file. So we have to silence -- all of its warnings one way or another. diff --git a/trample/CHANGELOG.md b/trample/CHANGELOG.md new file mode 100644 index 0000000..a7bec31 --- /dev/null +++ b/trample/CHANGELOG.md @@ -0,0 +1,12 @@ +# Changelog + +All notable changes to this project will be documented in this file. + +The format is based on [Keep a Changelog 1.1](https://keepachangelog.com/en/1.1.0/), +and this project adheres to the [Haskell Package Versioning Policy](https://pvp.haskell.org/). + +## [0.1.0.0] - 2024-08-28 + +### Added + +- initial release of this package diff --git a/trample/README.md b/trample/README.md new file mode 100644 index 0000000..cc1984b --- /dev/null +++ b/trample/README.md @@ -0,0 +1,94 @@ +# Haskerwaul Base Trampler + +[![Packaging status](https://repology.org/badge/tiny-repos/haskell:haskerwaul-trample.svg)](https://repology.org/project/haskell:haskerwaul-trample/versions) +[![latest packaged versions](https://repology.org/badge/latest-versions/haskell:haskerwaul-trample.svg)](https://repology.org/project/haskell:haskerwaul-trample/versions) + +## usage + +Depend on this package _instead of_ `base` to get Haskerwaul working with minimal code changes. + +## licensing + +This package is licensed under [The GNU AGPL 3.0 or later](./LICENSE). If you need a license for usage that isn’t covered under the AGPL, please contact [Greg Pfeil](mailto:greg@technomadic.org?subject=licensing%20no-recursion). + +You should review the [license report](docs/license-report.md) for details about dependency licenses. + +## versioning + +This project largely follows the [Haskell Package Versioning Policy](https://pvp.haskell.org/) (PVP), but is more strict in some ways. + +The version always has four components, `A.B.C.D`. The first three correspond to those required by PVP, while the fourth matches the “patch” component from [Semantic Versioning](https://semver.org/). + +Here is a breakdown of some of the constraints: + +### sensitivity to additions to the API + +PVP recommends that clients follow [these import guidelines](https://wiki.haskell.org/Import_modules_properly) in order that they may be considered insensitive to additions to the API. However, this isn’t sufficient. We expect clients to follow these additional recommendations for API insensitivity + +If you don’t follow these recommendations (in addition to the ones made by PVP), you should ensure your dependencies don’t allow a range of `C` values. That is, your dependencies should look like + +```cabal +yaya >=1.2.3 && <1.2.4 +``` + +rather than + +```cabal +yaya >=1.2.3 && <1.3 +``` + +#### use package-qualified imports everywhere + +If your imports are [package-qualified](https://downloads.haskell.org/ghc/latest/docs/users_guide/exts/package_qualified_imports.html?highlight=packageimports#extension-PackageImports), then a dependency adding new modules can’t cause a conflict with modules you already import. + +#### avoid orphans + +Because of the transitivity of instances, orphans make you sensitive to your dependencies’ instances. If you have an orphan instance, you are sensitive to the APIs of the packages that define the class and the types of the instance. + +One way to minimize this sensitivity is to have a separate package (or packages) dedicated to any orphans you have. Those packages can be sensitive to their dependencies’ APIs, while the primary package remains insensitive, relying on the tighter ranges of the orphan packages to constrain the solver. + +### transitively breaking changes (increments `A`) + +#### removing a type class instance + +Type class instances are imported transitively, and thus changing them can impact packages that only have your package as a transitive dependency. + +#### widening a dependency range with new major versions + +This is a consequence of instances being transitively imported. A new major version of a dependency can remove instances, and that can break downstream clients that unwittingly depended on those instances. + +A library MAY declare that it always bumps the `A` component when it removes an instance (as this policy dictates). In that case, only `A` widenings need to induce `A` bumps. `B` widenings can be `D` bumps like other widenings, Alternatively, one may compare the APIs when widening a dependency range, and if no instances have been removed, make it a `D` bump. + +### breaking changes (increments `B`) + +#### restricting an existing dependency’s version range in any way + +Consumers have to contend not only with our version bounds, but also with those of other libraries. It’s possible that some dependency overlapped in a very narrow way, and even just restricting a particular patch version of a dependency could make it impossible to find a dependency solution. + +#### restricting the license in any way + +Making a license more restrictive may prevent clients from being able to continue using the package. + +#### adding a dependency + +A new dependency may make it impossible to find a solution in the face of other packages dependency ranges. + +### non-breaking changes (increments `C`) + +#### adding a module + +This is also what PVP recommends. However, unlike in PVP, this is because we recommend that package-qualified imports be used on all imports. + +### other changes (increments `D`) + +#### widening a dependency range for non-major versions + +This is fairly uncommon, in the face of `^>=`-style ranges, but it can happen in a few situations. + +#### deprecation + +**NB**: This case is _weaker_ than PVP, which indicates that packages should bump their major version when adding `deprecation` pragmas. + +We disagree with this because packages shouldn’t be _publishing_ with `-Werror`. The intent of deprecation is to indicate that some API _will_ change. To make that signal a major change itself defeats the purpose. You want people to start seeing that warning as soon as possible. The major change occurs when you actually remove the old API. + +Yes, in development, `-Werror` is often (and should be) used. However, that just helps developers be aware of deprecations more immediately. They can always add `-Wwarn=deprecation` in some scope if they need to avoid updating it for the time being. diff --git a/trample/Setup.hs b/trample/Setup.hs index aee59ef..4d53144 100644 --- a/trample/Setup.hs +++ b/trample/Setup.hs @@ -1,12 +1,17 @@ -- __NB__: `custom-setup` doesn’t have any way to specify extensions or options, -- so any we want need to be specified here. +{-# LANGUAGE CPP #-} {-# LANGUAGE PackageImports #-} {-# LANGUAGE Unsafe #-} {-# LANGUAGE NoImplicitPrelude #-} +#if MIN_VERSION_GLASGOW_HASKELL(8, 0, 0, 0) {-# OPTIONS_GHC -Weverything #-} -- Warns even when `Unsafe` is explicit, not inferred. See -- https://gitlab.haskell.org/ghc/ghc/-/issues/16689 {-# OPTIONS_GHC -Wno-unsafe #-} +#else +{-# OPTIONS_GHC -Wall #-} +#endif module Main (main) where diff --git a/trample/docs/license-report.md b/trample/docs/license-report.md new file mode 100644 index 0000000..d2e2c8d --- /dev/null +++ b/trample/docs/license-report.md @@ -0,0 +1,41 @@ +**NB**: This captures the licenses associated with a particular set of dependency versions. If your own build solves differently, it’s possible that the licenses may have changed, or even that the set of dependencies itself is different. Please make sure you run [`cabal-plan license-report`](https://hackage.haskell.org/package/cabal-plan) on your own components rather than assuming this is authoritative. + +# Dependency License Report + +Bold-faced **`package-name`**s denote standard libraries bundled with `ghc-9.10.1`. + +## Direct dependencies of `haskerwaul-trample:lib:haskerwaul-trample` + +| Name | Version | [SPDX](https://spdx.org/licenses/) License Id | Description | Also depended upon by | +| --- | --- | --- | --- | --- | +| `haskerwaul-base` | [`0.1.0.0`](http://hackage.haskell.org/package/haskerwaul-base-0.1.0.0) | *MISSING* | *MISSING* | | + +## Indirect transitive dependencies + +| Name | Version | [SPDX](https://spdx.org/licenses/) License Id | Description | Depended upon by | +| --- | --- | --- | --- | --- | +| **`array`** | [`0.5.7.0`](http://hackage.haskell.org/package/array-0.5.7.0) | [`BSD-3-Clause`](http://hackage.haskell.org/package/array-0.5.7.0/src/LICENSE) | Mutable and immutable arrays | `binary`, `containers`, `deepseq`, `stm`, `text` | +| **`base`** | [`4.20.0.0`](http://hackage.haskell.org/package/base-4.20.0.0) | [`BSD-3-Clause`](http://hackage.haskell.org/package/base-4.20.0.0/src/LICENSE) | Core data structures and operations | *(core library)* | +| **`binary`** | [`0.8.9.2`](http://hackage.haskell.org/package/binary-0.8.9.2) | [`BSD-3-Clause`](http://hackage.haskell.org/package/binary-0.8.9.2/src/LICENSE) | Binary serialisation for Haskell values using lazy ByteStrings | `constraints`, `text` | +| `boring` | [`0.2.2`](http://hackage.haskell.org/package/boring-0.2.2) | [`BSD-3-Clause`](http://hackage.haskell.org/package/boring-0.2.2/src/LICENSE) | Boring and Absurd types | `constraints` | +| **`bytestring`** | [`0.12.1.0`](http://hackage.haskell.org/package/bytestring-0.12.1.0) | [`BSD-3-Clause`](http://hackage.haskell.org/package/bytestring-0.12.1.0/src/LICENSE) | Fast, compact, strict and lazy byte strings with a list interface | `binary`, `filepath`, `hashable`, `os-string`, `text` | +| `constraints` | [`0.14.2`](http://hackage.haskell.org/package/constraints-0.14.2) | [`BSD-2-Clause`](http://hackage.haskell.org/package/constraints-0.14.2/src/LICENSE) | Constraint manipulation | `haskerwaul` | +| **`containers`** | [`0.7`](http://hackage.haskell.org/package/containers-0.7) | [`BSD-3-Clause`](http://hackage.haskell.org/package/containers-0.7/src/LICENSE) | Assorted concrete container types | `binary`, `hashable`, `haskerwaul` | +| **`deepseq`** | [`1.5.0.0`](http://hackage.haskell.org/package/deepseq-1.5.0.0) | [`BSD-3-Clause`](http://hackage.haskell.org/package/deepseq-1.5.0.0/src/LICENSE) | Deep evaluation of data structures | `bytestring`, `constraints`, `containers`, `filepath`, `hashable`, `os-string`, `pretty`, `tagged`, `text` | +| **`exceptions`** | [`0.10.7`](http://hackage.haskell.org/package/exceptions-0.10.7) | [`BSD-3-Clause`](http://hackage.haskell.org/package/exceptions-0.10.7/src/LICENSE) | Extensible optionally-pure exceptions | `filepath`, `os-string` | +| **`filepath`** | [`1.5.2.0`](http://hackage.haskell.org/package/filepath-1.5.2.0) | [`BSD-3-Clause`](http://hackage.haskell.org/package/filepath-1.5.2.0/src/LICENSE) | Library for manipulating FilePaths in a cross platform way. | `hashable` | +| **`ghc-bignum`** | [`1.3`](http://hackage.haskell.org/package/ghc-bignum-1.3) | [`BSD-3-Clause`](http://hackage.haskell.org/package/ghc-bignum-1.3/src/LICENSE) | GHC BigNum library | `ghc-internal`, `hashable` | +| **`ghc-boot-th`** | [`9.10.1`](http://hackage.haskell.org/package/ghc-boot-th-9.10.1) | [`BSD-3-Clause`](http://hackage.haskell.org/package/ghc-boot-th-9.10.1/src/LICENSE) | Shared functionality between GHC and the @template-haskell@ library | `template-haskell` | +| **`ghc-internal`** | [`9.1001.0`](http://hackage.haskell.org/package/ghc-internal-9.1001.0) | [`BSD-3-Clause`](http://hackage.haskell.org/package/ghc-internal-9.1001.0/src/LICENSE) | Basic libraries | `base` | +| **`ghc-prim`** | [`0.11.0`](http://hackage.haskell.org/package/ghc-prim-0.11.0) | [`BSD-3-Clause`](http://hackage.haskell.org/package/ghc-prim-0.11.0/src/LICENSE) | GHC primitives | *(core library)* | +| `hashable` | [`1.5.0.0`](http://hackage.haskell.org/package/hashable-1.5.0.0) | [`BSD-3-Clause`](http://hackage.haskell.org/package/hashable-1.5.0.0/src/LICENSE) | A class for types that can be converted to a hash value | `constraints` | +| `haskerwaul` | [`0.1.0.0`](http://hackage.haskell.org/package/haskerwaul-0.1.0.0) | *MISSING* | *MISSING* | `haskerwaul-base` | +| **`mtl`** | [`2.3.1`](http://hackage.haskell.org/package/mtl-2.3.1) | [`BSD-3-Clause`](http://hackage.haskell.org/package/mtl-2.3.1/src/LICENSE) | Monad classes for transformers, using functional dependencies | `constraints`, `exceptions` | +| **`os-string`** | [`2.0.2`](http://hackage.haskell.org/package/os-string-2.0.2) | [`BSD-3-Clause`](http://hackage.haskell.org/package/os-string-2.0.2/src/LICENSE) | Library for manipulating Operating system strings. | `filepath`, `hashable` | +| **`pretty`** | [`1.1.3.6`](http://hackage.haskell.org/package/pretty-1.1.3.6) | [`BSD-3-Clause`](http://hackage.haskell.org/package/pretty-1.1.3.6/src/LICENSE) | Pretty-printing library | `template-haskell` | +| **`stm`** | [`2.5.3.1`](http://hackage.haskell.org/package/stm-2.5.3.1) | [`BSD-3-Clause`](http://hackage.haskell.org/package/stm-2.5.3.1/src/LICENSE) | Software Transactional Memory | `exceptions` | +| `tagged` | [`0.8.8`](http://hackage.haskell.org/package/tagged-0.8.8) | [`BSD-3-Clause`](http://hackage.haskell.org/package/tagged-0.8.8/src/LICENSE) | Haskell 98 phantom types to avoid unsafely passing dummy arguments | `boring` | +| **`template-haskell`** | [`2.22.0.0`](http://hackage.haskell.org/package/template-haskell-2.22.0.0) | [`BSD-3-Clause`](http://hackage.haskell.org/package/template-haskell-2.22.0.0/src/LICENSE) | Support library for Template Haskell | `bytestring`, `containers`, `exceptions`, `filepath`, `os-string`, `tagged`, `text` | +| **`text`** | [`2.1.1`](http://hackage.haskell.org/package/text-2.1.1) | [`BSD-2-Clause`](http://hackage.haskell.org/package/text-2.1.1/src/LICENSE) | An efficient packed Unicode text type. | `hashable` | +| **`transformers`** | [`0.6.1.1`](http://hackage.haskell.org/package/transformers-0.6.1.1) | [`BSD-3-Clause`](http://hackage.haskell.org/package/transformers-0.6.1.1/src/LICENSE) | Concrete functor and monad transformers | `boring`, `constraints`, `exceptions`, `mtl`, `tagged` | + diff --git a/trample/haskerwaul-trample.cabal b/trample/haskerwaul-trample.cabal index a1c81fa..655a39b 100644 --- a/trample/haskerwaul-trample.cabal +++ b/trample/haskerwaul-trample.cabal @@ -20,28 +20,26 @@ build-type: Custom license: AGPL-3.0-or-later license-files: LICENSE -extra-source-files: +extra-doc-files: + CHANGELOG.md README.md + docs/*.md tested-with: GHC == { --- GHCup Nixpkgs - 7.10.3, - 8.0.1, - 8.2.1, - 8.4.1, 8.6.1, - 8.8.1, 8.8.4, + 8.8.1, 8.10.1, 8.10.7, - 9.0.1, 9.0.2, - 9.2.1, 9.2.8, - 9.4.1, 9.4.8, - 9.6.1, 9.6.2, - 9.8.1 + 9.0.1, 9.0.2, + 9.2.1, 9.2.5, + 9.4.1, 9.4.5, + 9.6.1, 9.6.3, + 9.8.1, + 9.10.1 } source-repository head type: git - location: git@github.com:sellout/haskerwaul.git + location: https://github.com/sellout/haskerwaul -- This mimics the GHC2021 extension -- (https://ghc.gitlab.haskell.org/ghc/doc/users_guide/exts/control.html?highlight=doandifthenelse#extension-GHC2021), @@ -101,7 +99,7 @@ flag noisy-deprecations common defaults import: GHC2021 build-depends: - base ^>= {4.12.0, 4.13.0, 4.14.0, 4.15.0, 4.16.0, 4.17.0, 4.18.0, 4.19.0}, + base ^>= {4.12.0, 4.13.0, 4.14.0, 4.15.0, 4.16.0, 4.17.0, 4.18.0, 4.19.0, 4.20.0}, ghc-options: -Weverything -- Type inference good. @@ -154,6 +152,7 @@ common defaults NoImplicitPrelude NoMonomorphismRestriction NoPatternGuards + NoStarIsType NoTypeApplications if flag(noisy-deprecations) cpp-options: -DSELLOUT_NOISY_DEPRECATIONS @@ -162,7 +161,7 @@ custom-setup setup-depends: -- TODO: Remove `Cabal` dep once haskell/cabal#3751 is fixed. Cabal ^>= {3.0.0, 3.2.0, 3.4.0, 3.6.0, 3.8.0, 3.10.0}, - base ^>= {4.12.0, 4.13.0, 4.14.0, 4.15.0, 4.16.0, 4.17.0, 4.18.0, 4.19.0}, + base ^>= {4.12.0, 4.13.0, 4.14.0, 4.15.0, 4.16.0, 4.17.0, 4.18.0, 4.19.0, 4.20.0}, cabal-doctest ^>= {1.0.0}, -- This package should be able to be completely generated, since it just @@ -186,8 +185,14 @@ test-suite doctests hs-source-dirs: tests main-is: doctests.hs build-depends: - doctest ^>= {0.16.0, 0.18.1, 0.20.1, 0.21.1, 0.22.2}, + doctest ^>= {0.16.0, 0.17.0, 0.18.0, 0.19.0, 0.20.0, 0.21.0, 0.22.0}, haskerwaul-trample, + if impl(ghc >= 8.10.1) + ghc-options: + -- `doctest` requires the package containing the doctests as a dependency + -- to ensure it gets built before this test-suite, even though the package + -- appears to be unused. + -Wno-unused-packages -- TODO: The sections below here are necessary because we don’t have control -- over the generated `Build_doctests.hs` file. So we have to silence -- all of its warnings one way or another. From 8ec5681fa0de5e1f6c0830509545bb0f1500ae04 Mon Sep 17 00:00:00 2001 From: Greg Pfeil Date: Wed, 28 Aug 2024 17:29:41 -0600 Subject: [PATCH 3/6] Add fixity declarations for operators --- base/src/Haskerwaul/Base/Prelude.hs | 4 ++++ .../Category/Monoidal/Closed/Cartesian.hs | 14 ++++++++++++++ haskerwaul/src/Haskerwaul/Magma.hs | 2 ++ haskerwaul/src/Haskerwaul/Order/Linear.hs | 2 ++ haskerwaul/src/Haskerwaul/Order/Total.hs | 2 ++ haskerwaul/src/Haskerwaul/Preorder.hs | 2 ++ haskerwaul/src/Haskerwaul/Quasiorder.hs | 2 ++ haskerwaul/src/Haskerwaul/Relation/Equality.hs | 2 ++ .../src/Haskerwaul/Relation/Inequality.hs | 2 ++ hedgehog/src/Haskerwaul/Hedgehog.hs | 18 +++++++++--------- 10 files changed, 41 insertions(+), 9 deletions(-) diff --git a/base/src/Haskerwaul/Base/Prelude.hs b/base/src/Haskerwaul/Base/Prelude.hs index 7c7dc25..a5b34d4 100644 --- a/base/src/Haskerwaul/Base/Prelude.hs +++ b/base/src/Haskerwaul/Base/Prelude.hs @@ -30,6 +30,8 @@ import qualified Haskerwaul as H a `c` H.Exp c a a (&&) = H.curry @_ @(H.Prod c) H.meet +infixr 3 && + -- | Generalization of `Prelude.||`. (||) :: forall c a. @@ -37,6 +39,8 @@ import qualified Haskerwaul as H a `c` H.Exp c a a (||) = H.curry @_ @(H.Prod c) H.join +infixr 2 || + -- | Generalization of `Prelude.not`. not :: (H.UniquelyComplementedLattice c (,) a, H.Ob c a) => a `c` a not = H.complement (Proxy :: Proxy (,)) diff --git a/haskerwaul/src/Haskerwaul/Category/Monoidal/Closed/Cartesian.hs b/haskerwaul/src/Haskerwaul/Category/Monoidal/Closed/Cartesian.hs index f094f0c..0004e71 100644 --- a/haskerwaul/src/Haskerwaul/Category/Monoidal/Closed/Cartesian.hs +++ b/haskerwaul/src/Haskerwaul/Category/Monoidal/Closed/Cartesian.hs @@ -70,38 +70,52 @@ instance CartesianClosedMonoidalCategory (->) where InternalHom c a b `c` InternalHom c a b ($) = curry @_ @(Prod c) apply \\ inT @(Ob c) @(InternalHom c) @a @b +infix 0 $ + (<>) :: forall c a. (CartesianClosedMonoidalCategory c, Magma c (Prod c) a) => a `c` InternalHom c a a (<>) = curry @_ @(Prod c) op +infixr 6 <> + (.-) :: forall c a. (c ~ (->), CartesianClosedMonoidalCategory c, RigMonus c (Prod c) a) => a `c` InternalHom c a a (.-) = curry @_ @(Prod c) (sum . monus . bimap Add Add) +infixl 6 .- + (+) :: forall c a. (c ~ (->), CartesianClosedMonoidalCategory c, NearPreSemiring c (Prod c) a) => a `c` InternalHom c a a (+) = curry @_ @(Prod c) add +infixl 6 + + (*) :: forall c a. (c ~ (->), CartesianClosedMonoidalCategory c, NearPreSemiring c (Prod c) a) => a `c` InternalHom c a a (*) = curry @_ @(Prod c) multiply +infixl 7 * + (-) :: forall c a. (c ~ (->), CartesianClosedMonoidalCategory c, Ring c (Prod c) a) => a `c` InternalHom c a a (-) = curry @_ @(Prod c) subtract +infixl 6 - + (/) :: forall c a. (c ~ (->), CartesianClosedMonoidalCategory c, Skewfield c (Prod c) a) => a `c` InternalHom c a a (/) = curry @_ @(Prod c) divide + +infixl 7 / diff --git a/haskerwaul/src/Haskerwaul/Magma.hs b/haskerwaul/src/Haskerwaul/Magma.hs index dfcd568..e7bf8c4 100644 --- a/haskerwaul/src/Haskerwaul/Magma.hs +++ b/haskerwaul/src/Haskerwaul/Magma.hs @@ -150,6 +150,8 @@ instance Magma (:-) (&) (() :: Constraint) where a `c` b f . g = runDT op (Procompose f g) +infixr 9 . + -- | All `Base.Category` instances are also `Haskerwaul.Magmoid.Magmoid` -- instances. instance diff --git a/haskerwaul/src/Haskerwaul/Order/Linear.hs b/haskerwaul/src/Haskerwaul/Order/Linear.hs index e870428..13ab481 100644 --- a/haskerwaul/src/Haskerwaul/Order/Linear.hs +++ b/haskerwaul/src/Haskerwaul/Order/Linear.hs @@ -70,3 +70,5 @@ instance (>) :: (ElementaryTopos c, LinearOrder c a) => a `c` Exp c a (Class c) (>) = curry gt + +infix 4 > diff --git a/haskerwaul/src/Haskerwaul/Order/Total.hs b/haskerwaul/src/Haskerwaul/Order/Total.hs index 73fbcea..4da6107 100644 --- a/haskerwaul/src/Haskerwaul/Order/Total.hs +++ b/haskerwaul/src/Haskerwaul/Order/Total.hs @@ -67,3 +67,5 @@ instance (Base.Integral a) => TotalOrder (->) (Canonical (Ratio a)) (>=) :: (ElementaryTopos c, TotalOrder c a) => a `c` Exp c a (Class c) (>=) = curry ge + +infix 4 >= diff --git a/haskerwaul/src/Haskerwaul/Preorder.hs b/haskerwaul/src/Haskerwaul/Preorder.hs index a2f0c64..4a692b5 100644 --- a/haskerwaul/src/Haskerwaul/Preorder.hs +++ b/haskerwaul/src/Haskerwaul/Preorder.hs @@ -97,3 +97,5 @@ instance (<=) :: (ElementaryTopos c, Preorder c a) => a `c` Exp c a (Class c) (<=) = curry le + +infix 4 <= diff --git a/haskerwaul/src/Haskerwaul/Quasiorder.hs b/haskerwaul/src/Haskerwaul/Quasiorder.hs index c1a805b..18114f4 100644 --- a/haskerwaul/src/Haskerwaul/Quasiorder.hs +++ b/haskerwaul/src/Haskerwaul/Quasiorder.hs @@ -50,3 +50,5 @@ instance (<) :: (ElementaryTopos c, Quasiorder c a) => a `c` Exp c a (Class c) (<) = curry lt + +infix 4 < diff --git a/haskerwaul/src/Haskerwaul/Relation/Equality.hs b/haskerwaul/src/Haskerwaul/Relation/Equality.hs index c8dc503..681a0a9 100644 --- a/haskerwaul/src/Haskerwaul/Relation/Equality.hs +++ b/haskerwaul/src/Haskerwaul/Relation/Equality.hs @@ -29,3 +29,5 @@ instance (EquivalenceRelation c a, PartialOrder c a) => EqualityRelation c a (==) :: (ElementaryTopos c, EqualityRelation c a) => a `c` Exp c a (Class c) (==) = curry eq + +infix 4 == diff --git a/haskerwaul/src/Haskerwaul/Relation/Inequality.hs b/haskerwaul/src/Haskerwaul/Relation/Inequality.hs index 4921ca4..5433a38 100644 --- a/haskerwaul/src/Haskerwaul/Relation/Inequality.hs +++ b/haskerwaul/src/Haskerwaul/Relation/Inequality.hs @@ -78,3 +78,5 @@ instance InequalityRelation (->) Double where (/=) :: (ElementaryTopos c, InequalityRelation c a) => a `c` Exp c a (Class c) (/=) = curry ne + +infix 4 /= diff --git a/hedgehog/src/Haskerwaul/Hedgehog.hs b/hedgehog/src/Haskerwaul/Hedgehog.hs index 5ff0a7a..75b53db 100644 --- a/hedgehog/src/Haskerwaul/Hedgehog.hs +++ b/hedgehog/src/Haskerwaul/Hedgehog.hs @@ -115,10 +115,10 @@ unitalMagma_laws :: [(PropertyName, Property)] unitalMagma_laws label law transL transR dispL dispR genX1 genX2 = [ ( "left identity (" <> label <> ")", - property (runHH (checkLaw transL (leftIdentity law)) =<< forAllWith dispL $ genX1) + property (runHH (checkLaw transL (leftIdentity law)) =<< forAllWith dispL genX1) ), ( "right identity (" <> label <> ")", - property (runHH (checkLaw transR (rightIdentity law)) =<< forAllWith dispR $ genX2) + property (runHH (checkLaw transR (rightIdentity law)) =<< forAllWith dispR genX2) ) ] @@ -209,7 +209,7 @@ leftRegularBand_laws :: leftRegularBand_laws label law transA transG transI dispA dispG genX genX0 genY = band_laws label (LeftRegularBand.band law) transA transI dispA genX genY <> [ ( "graphic identity (" <> label <> ")", - property (runHH (checkLaw transG (graphicIdentity law)) =<< forAllWith dispG $ genX0) + property (runHH (checkLaw transG (graphicIdentity law)) =<< forAllWith dispG genX0) ) ] @@ -223,7 +223,7 @@ leftShelf_laws :: [(PropertyName, Property)] leftShelf_laws label law trans display gen = [ ( "left self-distributive (" <> label <> ")", - property (runHH (checkLaw trans (leftSelfDistributive law)) =<< forAllWith display $ gen) + property (runHH (checkLaw trans (leftSelfDistributive law)) =<< forAllWith display gen) ) ] @@ -237,7 +237,7 @@ rightShelf_laws :: [(PropertyName, Property)] rightShelf_laws label law trans display gen = [ ( "right self-distributive (" <> label <> ")", - property (runHH (checkLaw trans (rightSelfDistributive law)) =<< forAllWith display $ gen) + property (runHH (checkLaw trans (rightSelfDistributive law)) =<< forAllWith display gen) ) ] @@ -377,16 +377,16 @@ duoid_laws monoid_laws label (diamond law) trans transL transR display dispL dispR genX genX1 genX2 <> monoid_laws label (star law) trans' transL' transR' display' dispL' dispR' genX' genX1' genX2' <> [ ( "interchange (" <> label <> ")", - property (runHH (checkLaw trans'' (interchange' law)) =<< forAllWith display'' $ genX'') + property (runHH (checkLaw trans'' (interchange' law)) =<< forAllWith display'' genX'') ), ( "diamond unit (" <> label <> ")", - property (runHH (checkLaw transD (diamondUnit law)) =<< forAllWith dispD $ genX1'') + property (runHH (checkLaw transD (diamondUnit law)) =<< forAllWith dispD genX1'') ), ( "star unit (" <> label <> ")", - property (runHH (checkLaw transS (starUnit law)) =<< forAllWith dispS $ genX2'') + property (runHH (checkLaw transS (starUnit law)) =<< forAllWith dispS genX2'') ), ( "unit (" <> label <> ")", - property (runHH (checkLaw transD (unit' law)) =<< forAllWith dispD $ genX1'') + property (runHH (checkLaw transD (unit' law)) =<< forAllWith dispD genX1'') ) ] From 4ed2a430d188f73748de2115aa9fa571580a4725 Mon Sep 17 00:00:00 2001 From: Greg Pfeil Date: Tue, 27 Aug 2024 23:31:15 -0600 Subject: [PATCH 4/6] Disable `-package-trust` MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit It’s way more trouble than it’s worth. This also fleshes out haskerwaul-base and haskerwaul-trample enough to not require base for -trample’s doctests. --- base/README.md | 20 +++++++++ base/haskerwaul-base.cabal | 13 +++--- base/src/Haskerwaul/Base/Data/Eq.hs | 12 +++++ base/src/Haskerwaul/Base/Data/Function.hs | 8 ++++ base/src/Haskerwaul/Base/Data/Maybe.hs | 8 ++++ base/src/Haskerwaul/Base/Data/Semigroup.hs | 10 +++++ base/src/Haskerwaul/Base/Data/String.hs | 8 ++++ base/src/Haskerwaul/Base/Data/Tuple.hs | 16 +++++++ base/src/Haskerwaul/Base/Prelude.hs | 52 +++++++++++----------- base/src/Haskerwaul/Base/System/IO.hs | 8 ++++ base/src/Haskerwaul/Base/Text/Show.hs | 8 ++++ haskerwaul/haskerwaul.cabal | 6 --- hedgehog/haskerwaul-hedgehog.cabal | 5 --- trample/haskerwaul-trample.cabal | 21 +++++---- trample/src/Data/Eq.hs | 8 ++++ trample/src/Data/Function.hs | 8 ++++ trample/src/Data/Maybe.hs | 8 ++++ trample/src/Data/Semigroup.hs | 8 ++++ trample/src/Data/String.hs | 8 ++++ trample/src/Data/Tuple.hs | 8 ++++ trample/src/System/IO.hs | 8 ++++ trample/src/Text/Show.hs | 8 ++++ trample/tests/doctests.hs | 6 +-- 23 files changed, 209 insertions(+), 56 deletions(-) create mode 100644 base/src/Haskerwaul/Base/Data/Eq.hs create mode 100644 base/src/Haskerwaul/Base/Data/Function.hs create mode 100644 base/src/Haskerwaul/Base/Data/Maybe.hs create mode 100644 base/src/Haskerwaul/Base/Data/Semigroup.hs create mode 100644 base/src/Haskerwaul/Base/Data/String.hs create mode 100644 base/src/Haskerwaul/Base/Data/Tuple.hs create mode 100644 base/src/Haskerwaul/Base/System/IO.hs create mode 100644 base/src/Haskerwaul/Base/Text/Show.hs create mode 100644 trample/src/Data/Eq.hs create mode 100644 trample/src/Data/Function.hs create mode 100644 trample/src/Data/Maybe.hs create mode 100644 trample/src/Data/Semigroup.hs create mode 100644 trample/src/Data/String.hs create mode 100644 trample/src/Data/Tuple.hs create mode 100644 trample/src/System/IO.hs create mode 100644 trample/src/Text/Show.hs diff --git a/base/README.md b/base/README.md index 9e9fa34..7a2d212 100644 --- a/base/README.md +++ b/base/README.md @@ -7,6 +7,26 @@ This package offers the same modules as `base`, but with each prefixed with `Haskerwaul.Base.`. You can update imports incrementally to see what works under Haskerwaul and what doesn’t. +### caveats + +If this provided exactly the same API as base, there wouldn’t be much point to this package. Consequently, there are a number of differences. + +#### type classes + +The type classes provided by this package are generally constrained aliases of the type classes provided by Haskerwaul. This means that the “methods” aren’t, which affects how things are imported. E.g., if you tend to do + +```haskell +import Data.Semigroup (Semigroup((<>))) +``` + +you will need to change that to + +```haskell +import Data.Semigroup (Semigroup, (<>)) +``` + +which is strictly more portable. + ## licensing This package is licensed under [The GNU AGPL 3.0 or later](./LICENSE). If you need a license for usage that isn’t covered under the AGPL, please contact [Greg Pfeil](mailto:greg@technomadic.org?subject=licensing%20no-recursion). diff --git a/base/haskerwaul-base.cabal b/base/haskerwaul-base.cabal index fc00ab0..9898a02 100644 --- a/base/haskerwaul-base.cabal +++ b/base/haskerwaul-base.cabal @@ -105,8 +105,6 @@ common defaults -Wno-unsafe -- TODO: prune these warnings -Wno-all-missed-specialisations - -fpackage-trust - -trust base if impl(ghc < 8.8.1) ghc-options: -- This used to warn even when `Safe` was explicit. @@ -117,8 +115,6 @@ common defaults -Wno-inferred-safe-imports -- We support GHC versions without qualified-post. -Wno-prepositive-qualified-module - -- `-trust` triggers this warning when applied to transitive dependencies. - -Wno-unused-packages if impl(ghc >= 9.2.1) ghc-options: -- We support GHC versions without kind signatures. @@ -169,9 +165,16 @@ library ghc-options: -Wno-missing-export-lists -Wno-missing-import-lists - -trust constraints exposed-modules: + Haskerwaul.Base.Data.Eq + Haskerwaul.Base.Data.Function + Haskerwaul.Base.Data.Maybe + Haskerwaul.Base.Data.Semigroup + Haskerwaul.Base.Data.String + Haskerwaul.Base.Data.Tuple Haskerwaul.Base.Prelude + Haskerwaul.Base.System.IO + Haskerwaul.Base.Text.Show test-suite doctests import: defaults diff --git a/base/src/Haskerwaul/Base/Data/Eq.hs b/base/src/Haskerwaul/Base/Data/Eq.hs new file mode 100644 index 0000000..8d6c522 --- /dev/null +++ b/base/src/Haskerwaul/Base/Data/Eq.hs @@ -0,0 +1,12 @@ +{-# LANGUAGE Safe #-} + +module Haskerwaul.Base.Data.Eq + ( Eq, + (==), + (/=), + ) +where + +import Data.Eq (Eq) +import Haskerwaul.Relation.Equality ((==)) +import Haskerwaul.Relation.Inequality ((/=)) diff --git a/base/src/Haskerwaul/Base/Data/Function.hs b/base/src/Haskerwaul/Base/Data/Function.hs new file mode 100644 index 0000000..63de047 --- /dev/null +++ b/base/src/Haskerwaul/Base/Data/Function.hs @@ -0,0 +1,8 @@ +{-# LANGUAGE Safe #-} + +module Haskerwaul.Base.Data.Function + ( ($), + ) +where + +import Haskerwaul.Category.Monoidal.Closed.Cartesian (($)) diff --git a/base/src/Haskerwaul/Base/Data/Maybe.hs b/base/src/Haskerwaul/Base/Data/Maybe.hs new file mode 100644 index 0000000..97d8bf2 --- /dev/null +++ b/base/src/Haskerwaul/Base/Data/Maybe.hs @@ -0,0 +1,8 @@ +{-# LANGUAGE Safe #-} + +module Haskerwaul.Base.Data.Maybe + ( Maybe (..), + ) +where + +import Data.Maybe (Maybe (..)) diff --git a/base/src/Haskerwaul/Base/Data/Semigroup.hs b/base/src/Haskerwaul/Base/Data/Semigroup.hs new file mode 100644 index 0000000..67f5b69 --- /dev/null +++ b/base/src/Haskerwaul/Base/Data/Semigroup.hs @@ -0,0 +1,10 @@ +{-# LANGUAGE Safe #-} + +module Haskerwaul.Base.Data.Semigroup + ( Semigroup, + (<>), + ) +where + +import Data.Semigroup (Semigroup) +import Haskerwaul.Category.Monoidal.Closed.Cartesian ((<>)) diff --git a/base/src/Haskerwaul/Base/Data/String.hs b/base/src/Haskerwaul/Base/Data/String.hs new file mode 100644 index 0000000..fe84a4a --- /dev/null +++ b/base/src/Haskerwaul/Base/Data/String.hs @@ -0,0 +1,8 @@ +{-# LANGUAGE Safe #-} + +module Haskerwaul.Base.Data.String + ( module Data.String, + ) +where + +import Data.String (String) diff --git a/base/src/Haskerwaul/Base/Data/Tuple.hs b/base/src/Haskerwaul/Base/Data/Tuple.hs new file mode 100644 index 0000000..f0722fd --- /dev/null +++ b/base/src/Haskerwaul/Base/Data/Tuple.hs @@ -0,0 +1,16 @@ +{-# LANGUAGE Safe #-} + +module Haskerwaul.Base.Data.Tuple + ( curry, + uncurry, + ) +where + +import qualified Haskerwaul.Category.Monoidal.Closed as Haskerwaul +import Haskerwaul.Object + +curry :: (Ob (->) x, Ob (->) y, Ob (->) z) => ((x, y) -> z) -> x -> y -> z +curry = Haskerwaul.curry + +uncurry :: (Ob (->) x, Ob (->) y, Ob (->) z) => (x -> y -> z) -> (x, y) -> z +uncurry = Haskerwaul.uncurry diff --git a/base/src/Haskerwaul/Base/Prelude.hs b/base/src/Haskerwaul/Base/Prelude.hs index a5b34d4..5dd20f2 100644 --- a/base/src/Haskerwaul/Base/Prelude.hs +++ b/base/src/Haskerwaul/Base/Prelude.hs @@ -1,6 +1,5 @@ {-# LANGUAGE CPP #-} {-# LANGUAGE Safe #-} -{-# LANGUAGE TypeApplications #-} {-# LANGUAGE TypeFamilies #-} -- | This is intended to be a /mostly/ drop-in replacement for "Prelude", but @@ -15,29 +14,44 @@ -- methods), which means those are not any more general. But we've tried to -- ensure that those type classes imply our own, so instances of them should -- be usable with the rest of "Haskerwaul". -module Haskerwaul.Base.Prelude where +module Haskerwaul.Base.Prelude + ( module Haskerwaul.Base.Data.Eq, + module Haskerwaul.Base.Data.Maybe, + module Haskerwaul.Base.Data.String, + module Haskerwaul.Base.Text.Show, + (&&), + (||), + not, + otherwise, + either, + fst, + snd, + curry, + uncurry, + subtract, + ) +where import Data.Proxy (Proxy (..)) #if MIN_VERSION_base(4, 17, 0) import Data.Type.Equality (type (~)) #endif import qualified Haskerwaul as H +import Haskerwaul.Base.Data.Eq (Eq, (/=), (==)) +import Haskerwaul.Base.Data.Maybe (Maybe (..)) +import Haskerwaul.Base.Data.String (String) +import Haskerwaul.Base.Data.Tuple (curry, uncurry) +import Haskerwaul.Base.Text.Show (Show (..)) -- | Generalization of `Prelude.&&`. -(&&) :: - forall c a. - (c ~ (->), H.CartesianClosedMonoidalCategory c, H.Lattice c (H.Prod c) a) => - a `c` H.Exp c a a -(&&) = H.curry @_ @(H.Prod c) H.meet +(&&) :: forall c a. (c ~ (->), H.Lattice c (H.Prod c) a) => a `c` H.Exp c a a +(&&) = curry H.meet infixr 3 && -- | Generalization of `Prelude.||`. -(||) :: - forall c a. - (c ~ (->), H.CartesianClosedMonoidalCategory c, H.Lattice c (H.Prod c) a) => - a `c` H.Exp c a a -(||) = H.curry @_ @(H.Prod c) H.join +(||) :: forall c a. (c ~ (->), H.Lattice c (H.Prod c) a) => a `c` H.Exp c a a +(||) = curry H.join infixr 2 || @@ -65,20 +79,6 @@ fst = H.exl snd :: (H.CartesianMonoidalCategory c, H.Ob c a, H.Ob c b) => H.Prod c a b `c` b snd = H.exr --- | Generalization of `Prelude.curry`. -curry :: - (H.ClosedMonoidalCategory c t, H.Ob c x, H.Ob c y, H.Ob c z) => - t x y `c` z -> - x `c` H.InternalHom c y z -curry = H.curry - --- | Generalization of `Prelude.uncurry`. -uncurry :: - (H.ClosedMonoidalCategory c t, H.Ob c x, H.Ob c y, H.Ob c z) => - x `c` H.InternalHom c y z -> - t x y `c` z -uncurry = H.uncurry - -- | Generalization of `Prelude.subtract`. subtract :: (c ~ (->), H.CartesianClosedMonoidalCategory c, H.Ring c (H.Prod c) a) => diff --git a/base/src/Haskerwaul/Base/System/IO.hs b/base/src/Haskerwaul/Base/System/IO.hs new file mode 100644 index 0000000..e19b952 --- /dev/null +++ b/base/src/Haskerwaul/Base/System/IO.hs @@ -0,0 +1,8 @@ +{-# LANGUAGE Safe #-} + +module Haskerwaul.Base.System.IO + ( module System.IO, + ) +where + +import System.IO (IO) diff --git a/base/src/Haskerwaul/Base/Text/Show.hs b/base/src/Haskerwaul/Base/Text/Show.hs new file mode 100644 index 0000000..808d178 --- /dev/null +++ b/base/src/Haskerwaul/Base/Text/Show.hs @@ -0,0 +1,8 @@ +{-# LANGUAGE Safe #-} + +module Haskerwaul.Base.Text.Show + ( Show (..), + ) +where + +import Text.Show (Show (..)) diff --git a/haskerwaul/haskerwaul.cabal b/haskerwaul/haskerwaul.cabal index b7f2efd..4e6c14f 100644 --- a/haskerwaul/haskerwaul.cabal +++ b/haskerwaul/haskerwaul.cabal @@ -104,8 +104,6 @@ common defaults -Wno-unsafe -- TODO: prune these warnings -Wno-all-missed-specialisations - -fpackage-trust - -trust base if impl(ghc < 8.8.1) ghc-options: -- This used to warn even when `Safe` was explicit. @@ -116,8 +114,6 @@ common defaults -Wno-inferred-safe-imports -- We support GHC versions without qualified-post. -Wno-prepositive-qualified-module - -- `-trust` triggers this warning when applied to transitive dependencies. - -Wno-unused-packages if impl(ghc >= 9.2.1) ghc-options: -- We support GHC versions without kind signatures. @@ -171,8 +167,6 @@ library -Wno-missing-export-lists -Wno-missing-import-lists -Wno-simplifiable-class-constraints - -trust constraints - -trust containers exposed-modules: Haskerwaul Haskerwaul.Algebra.Boolean diff --git a/hedgehog/haskerwaul-hedgehog.cabal b/hedgehog/haskerwaul-hedgehog.cabal index ae304e1..9743e7a 100644 --- a/hedgehog/haskerwaul-hedgehog.cabal +++ b/hedgehog/haskerwaul-hedgehog.cabal @@ -103,8 +103,6 @@ common defaults -Wno-unsafe -- TODO: prune these warnings -Wno-all-missed-specialisations - -fpackage-trust - -trust base if impl(ghc < 8.8.1) ghc-options: -- This used to warn even when `Safe` was explicit. @@ -115,8 +113,6 @@ common defaults -Wno-inferred-safe-imports -- We support GHC versions without qualified-post. -Wno-prepositive-qualified-module - -- `-trust` triggers this warning when applied to transitive dependencies. - -Wno-unused-packages if impl(ghc >= 9.2.1) ghc-options: -- We support GHC versions without kind signatures. @@ -173,7 +169,6 @@ library -Wno-missing-export-lists -Wno-missing-import-lists -Wno-simplifiable-class-constraints - -trust constraints exposed-modules: Haskerwaul.Hedgehog Haskerwaul.Hedgehog.Applied.Set diff --git a/trample/haskerwaul-trample.cabal b/trample/haskerwaul-trample.cabal index 655a39b..2c624e3 100644 --- a/trample/haskerwaul-trample.cabal +++ b/trample/haskerwaul-trample.cabal @@ -98,8 +98,6 @@ flag noisy-deprecations common defaults import: GHC2021 - build-depends: - base ^>= {4.12.0, 4.13.0, 4.14.0, 4.15.0, 4.16.0, 4.17.0, 4.18.0, 4.19.0, 4.20.0}, ghc-options: -Weverything -- Type inference good. @@ -109,8 +107,6 @@ common defaults -Wno-unsafe -- TODO: prune these warnings -Wno-all-missed-specialisations - -fpackage-trust - -trust base if impl(ghc < 8.8.1) ghc-options: -- This used to warn even when `Safe` was explicit. @@ -121,8 +117,6 @@ common defaults -Wno-inferred-safe-imports -- We support GHC versions without qualified-post. -Wno-prepositive-qualified-module - -- `-trust` triggers this warning when applied to transitive dependencies. - -Wno-unused-packages if impl(ghc >= 9.2.1) ghc-options: -- We support GHC versions without kind signatures. @@ -176,8 +170,16 @@ library ghc-options: -Wno-missing-export-lists -Wno-missing-import-lists - -trust constraints - exposed-modules: Prelude + exposed-modules: + Data.Eq + Data.Function + Data.Maybe + Data.Semigroup + Data.String + Data.Tuple + Prelude + System.IO + Text.Show test-suite doctests import: defaults @@ -196,9 +198,6 @@ test-suite doctests -- TODO: The sections below here are necessary because we don’t have control -- over the generated `Build_doctests.hs` file. So we have to silence -- all of its warnings one way or another. - mixins: - -- NB: The dependency on haskerwaul-trample is only to force it to build before the doctests. Therefore, we can hide the "Prelude" that conflicts with the one from base that’s imported by Build_doctests.hs. - haskerwaul-trample hiding (Prelude) ghc-options: -Wno-missing-export-lists -Wno-missing-import-lists diff --git a/trample/src/Data/Eq.hs b/trample/src/Data/Eq.hs new file mode 100644 index 0000000..ff3e4e4 --- /dev/null +++ b/trample/src/Data/Eq.hs @@ -0,0 +1,8 @@ +{-# LANGUAGE Safe #-} + +module Data.Eq + ( module Haskerwaul.Base.Data.Eq, + ) +where + +import Haskerwaul.Base.Data.Eq diff --git a/trample/src/Data/Function.hs b/trample/src/Data/Function.hs new file mode 100644 index 0000000..4c2b0f7 --- /dev/null +++ b/trample/src/Data/Function.hs @@ -0,0 +1,8 @@ +{-# LANGUAGE Safe #-} + +module Data.Function + ( module Haskerwaul.Base.Data.Function, + ) +where + +import Haskerwaul.Base.Data.Function diff --git a/trample/src/Data/Maybe.hs b/trample/src/Data/Maybe.hs new file mode 100644 index 0000000..3221790 --- /dev/null +++ b/trample/src/Data/Maybe.hs @@ -0,0 +1,8 @@ +{-# LANGUAGE Safe #-} + +module Data.Maybe + ( module Haskerwaul.Base.Data.Maybe, + ) +where + +import Haskerwaul.Base.Data.Maybe diff --git a/trample/src/Data/Semigroup.hs b/trample/src/Data/Semigroup.hs new file mode 100644 index 0000000..06e3b62 --- /dev/null +++ b/trample/src/Data/Semigroup.hs @@ -0,0 +1,8 @@ +{-# LANGUAGE Safe #-} + +module Data.Semigroup + ( module Haskerwaul.Base.Data.Semigroup, + ) +where + +import Haskerwaul.Base.Data.Semigroup diff --git a/trample/src/Data/String.hs b/trample/src/Data/String.hs new file mode 100644 index 0000000..fedcd22 --- /dev/null +++ b/trample/src/Data/String.hs @@ -0,0 +1,8 @@ +{-# LANGUAGE Safe #-} + +module Data.String + ( module Haskerwaul.Base.Data.String, + ) +where + +import Haskerwaul.Base.Data.String diff --git a/trample/src/Data/Tuple.hs b/trample/src/Data/Tuple.hs new file mode 100644 index 0000000..6599d22 --- /dev/null +++ b/trample/src/Data/Tuple.hs @@ -0,0 +1,8 @@ +{-# LANGUAGE Safe #-} + +module Data.Tuple + ( module Haskerwaul.Base.Data.Tuple, + ) +where + +import Haskerwaul.Base.Data.Tuple diff --git a/trample/src/System/IO.hs b/trample/src/System/IO.hs new file mode 100644 index 0000000..c9e8c12 --- /dev/null +++ b/trample/src/System/IO.hs @@ -0,0 +1,8 @@ +{-# LANGUAGE Safe #-} + +module System.IO + ( module Haskerwaul.Base.System.IO, + ) +where + +import Haskerwaul.Base.System.IO diff --git a/trample/src/Text/Show.hs b/trample/src/Text/Show.hs new file mode 100644 index 0000000..e468583 --- /dev/null +++ b/trample/src/Text/Show.hs @@ -0,0 +1,8 @@ +{-# LANGUAGE Safe #-} + +module Text.Show + ( module Haskerwaul.Base.Text.Show, + ) +where + +import Haskerwaul.Base.Text.Show diff --git a/trample/tests/doctests.hs b/trample/tests/doctests.hs index 00540fc..c106cfb 100644 --- a/trample/tests/doctests.hs +++ b/trample/tests/doctests.hs @@ -2,10 +2,10 @@ module Main (main) where -import safe "base" Data.Function (($)) -import safe "base" Data.Semigroup (Semigroup ((<>))) -import safe "base" System.IO (IO) import "doctest" Test.DocTest (doctest) +import safe "haskerwaul-trample" Data.Function (($)) +import safe "haskerwaul-trample" Data.Semigroup ((<>)) +import safe "haskerwaul-trample" System.IO (IO) import "this" Build_doctests (flags, module_sources, pkgs) main :: IO () From a94e0eaa23b5afe76f8591b4af3c50e83bd638d7 Mon Sep 17 00:00:00 2001 From: Greg Pfeil Date: Sun, 1 Sep 2024 23:29:05 -0600 Subject: [PATCH 5/6] Disable trample doctests on GHC 8.6 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit These currently fail to build, so they’re disabled for now. --- trample/haskerwaul-trample.cabal | 60 +++++++++++++++++--------------- 1 file changed, 31 insertions(+), 29 deletions(-) diff --git a/trample/haskerwaul-trample.cabal b/trample/haskerwaul-trample.cabal index 2c624e3..0317e03 100644 --- a/trample/haskerwaul-trample.cabal +++ b/trample/haskerwaul-trample.cabal @@ -181,33 +181,35 @@ library System.IO Text.Show -test-suite doctests - import: defaults - type: exitcode-stdio-1.0 - hs-source-dirs: tests - main-is: doctests.hs - build-depends: - doctest ^>= {0.16.0, 0.17.0, 0.18.0, 0.19.0, 0.20.0, 0.21.0, 0.22.0}, - haskerwaul-trample, - if impl(ghc >= 8.10.1) - ghc-options: - -- `doctest` requires the package containing the doctests as a dependency - -- to ensure it gets built before this test-suite, even though the package - -- appears to be unused. - -Wno-unused-packages - -- TODO: The sections below here are necessary because we don’t have control - -- over the generated `Build_doctests.hs` file. So we have to silence - -- all of its warnings one way or another. - ghc-options: - -Wno-missing-export-lists - -Wno-missing-import-lists - -Wno-safe - if impl(ghc >= 8.8.1) +-- FIXME: These tests fail to build on GHC 8.6. +if impl(ghc >= 8.8.0) + test-suite doctests + import: defaults + type: exitcode-stdio-1.0 + hs-source-dirs: tests + main-is: doctests.hs + build-depends: + doctest ^>= {0.16.0, 0.17.0, 0.18.0, 0.19.0, 0.20.0, 0.21.0, 0.22.0}, + haskerwaul-trample, + if impl(ghc >= 8.10.1) + ghc-options: + -- `doctest` requires the package containing the doctests as a dependency + -- to ensure it gets built before this test-suite, even though the package + -- appears to be unused. + -Wno-unused-packages + -- TODO: The sections below here are necessary because we don’t have control + -- over the generated `Build_doctests.hs` file. So we have to silence + -- all of its warnings one way or another. ghc-options: - -- This used to warn even when `Safe` was explicit. - -Wno-missing-deriving-strategies - default-extensions: - -- Since we can’t add `{-# LANGUAGE Safe -#}` to the generated - -- “Build_doctests.hs”, we set it here, and that means it has to match - -- doctests.hs, which is `Unsafe`. - Unsafe + -Wno-missing-export-lists + -Wno-missing-import-lists + -Wno-safe + if impl(ghc >= 8.8.1) + ghc-options: + -- This used to warn even when `Safe` was explicit. + -Wno-missing-deriving-strategies + default-extensions: + -- Since we can’t add `{-# LANGUAGE Safe -#}` to the generated + -- “Build_doctests.hs”, we set it here, and that means it has to match + -- doctests.hs, which is `Unsafe`. + Unsafe From dd415996a920fb3e559f74aa1002033e97f18435 Mon Sep 17 00:00:00 2001 From: Greg Pfeil Date: Mon, 2 Sep 2024 00:36:15 -0600 Subject: [PATCH 6/6] Correct dependency ranges --- base/haskerwaul-base.cabal | 2 +- haskerwaul/haskerwaul.cabal | 2 +- hedgehog/haskerwaul-hedgehog.cabal | 2 +- trample/haskerwaul-trample.cabal | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/base/haskerwaul-base.cabal b/base/haskerwaul-base.cabal index 9898a02..4fa943d 100644 --- a/base/haskerwaul-base.cabal +++ b/base/haskerwaul-base.cabal @@ -182,7 +182,7 @@ test-suite doctests hs-source-dirs: tests main-is: doctests.hs build-depends: - doctest ^>= {0.16.0, 0.17.0, 0.18.0, 0.19.0, 0.20.0, 0.21.0, 0.22.0}, + doctest ^>= {0.16.0, 0.18.1, 0.20.1, 0.21.1, 0.22.2}, haskerwaul-base, if impl(ghc >= 8.10.1) ghc-options: diff --git a/haskerwaul/haskerwaul.cabal b/haskerwaul/haskerwaul.cabal index 4e6c14f..c216f9a 100644 --- a/haskerwaul/haskerwaul.cabal +++ b/haskerwaul/haskerwaul.cabal @@ -469,7 +469,7 @@ test-suite doctests hs-source-dirs: tests main-is: doctests.hs build-depends: - doctest ^>= {0.16.0, 0.17.0, 0.18.0, 0.19.0, 0.20.0, 0.21.0, 0.22.0}, + doctest ^>= {0.16.0, 0.18.1, 0.20.1, 0.21.1, 0.22.2}, haskerwaul, if impl(ghc >= 8.10.1) ghc-options: diff --git a/hedgehog/haskerwaul-hedgehog.cabal b/hedgehog/haskerwaul-hedgehog.cabal index 9743e7a..7667c4d 100644 --- a/hedgehog/haskerwaul-hedgehog.cabal +++ b/hedgehog/haskerwaul-hedgehog.cabal @@ -180,7 +180,7 @@ test-suite doctests hs-source-dirs: tests main-is: doctests.hs build-depends: - doctest ^>= {0.16.0, 0.17.0, 0.18.0, 0.19.0, 0.20.0, 0.21.0, 0.22.0}, + doctest ^>= {0.16.0, 0.18.1, 0.20.1, 0.21.1, 0.22.2}, haskerwaul-hedgehog, if impl(ghc >= 8.10.1) ghc-options: diff --git a/trample/haskerwaul-trample.cabal b/trample/haskerwaul-trample.cabal index 0317e03..5ea0207 100644 --- a/trample/haskerwaul-trample.cabal +++ b/trample/haskerwaul-trample.cabal @@ -189,7 +189,7 @@ if impl(ghc >= 8.8.0) hs-source-dirs: tests main-is: doctests.hs build-depends: - doctest ^>= {0.16.0, 0.17.0, 0.18.0, 0.19.0, 0.20.0, 0.21.0, 0.22.0}, + doctest ^>= {0.16.0, 0.18.1, 0.20.1, 0.21.1, 0.22.2}, haskerwaul-trample, if impl(ghc >= 8.10.1) ghc-options: