diff --git a/.github/workflows/nix.yml b/.github/workflows/nix.yml index 9144d1fd..7f438651 100644 --- a/.github/workflows/nix.yml +++ b/.github/workflows/nix.yml @@ -40,11 +40,33 @@ jobs: run: nix --print-build-logs build .#packages.${{ matrix.system }}.monad-bayes - name: Development environment (package only) run: nix --print-build-logs develop .#packages.${{ matrix.system }}.monad-bayes --command echo Ready - - name: All GHCs - run: nix --print-build-logs build .#packages.${{ matrix.system }}.monad-bayes-all-ghcs + + build-all-ghcs: + needs: lint + strategy: + matrix: + ghc: ["ghc902", "ghc927", "ghc945", "ghc964", "ghc982", "ghc9101"] + include: + - os: ubuntu-latest + system: x86_64-linux + - os: macos-latest + system: x86_64-darwin + runs-on: ${{ matrix.os }} + steps: + - uses: actions/checkout@v4 + - name: Setup Nix Environment + uses: ./.github/actions/nix-common-setup + with: + CACHIX_AUTH_TOKEN: ${{ secrets.CACHIX_AUTH_TOKEN }} + - name: Build + run: nix --print-build-logs build .#packages.${{ matrix.system }}.monad-bayes-per-ghc.${{ matrix.ghc }} + - name: Development environment (package only) + run: nix --print-build-logs develop .#packages.${{ matrix.system }}.monad-bayes-per-ghc.${{ matrix.ghc }} --command echo Ready notebooks: - needs: build + needs: + - build + - build-all-ghcs strategy: matrix: include: diff --git a/CHANGELOG.md b/CHANGELOG.md index 52c38bad..76c6edb6 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,7 @@ +# 1.3.0.3 + +- Relaxed some version bounds + # 1.3.0.2 - Relaxed some version bounds diff --git a/flake.lock b/flake.lock index b7b61ccd..007c4475 100644 --- a/flake.lock +++ b/flake.lock @@ -69,11 +69,11 @@ "systems": "systems" }, "locked": { - "lastModified": 1710146030, - "narHash": "sha256-SZ5L6eA7HJ/nmkzGG7/ISclqe6oZdOZTNoesiInkXPQ=", + "lastModified": 1726560853, + "narHash": "sha256-X6rJYSESBVr3hBoH0WbKE5KvhPU5bloyZ2L4K60/fPQ=", "owner": "numtide", "repo": "flake-utils", - "rev": "b1d9ab70662946ef0850d488da1c9019f3a9752a", + "rev": "c1dfcf08411b08f6b8615f7d8971a2bfa81d5e8a", "type": "github" }, "original": { @@ -332,16 +332,16 @@ }, "nixpkgs-stable_3": { "locked": { - "lastModified": 1718811006, - "narHash": "sha256-0Y8IrGhRmBmT7HHXlxxepg2t8j1X90++qRN3lukGaIk=", + "lastModified": 1730741070, + "narHash": "sha256-edm8WG19kWozJ/GqyYx2VjW99EdhjKwbY3ZwdlPAAlo=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "03d771e513ce90147b65fe922d87d3a0356fc125", + "rev": "d063c1dd113c91ab27959ba540c0d9753409edf3", "type": "github" }, "original": { "owner": "NixOS", - "ref": "nixos-23.11", + "ref": "nixos-24.05", "repo": "nixpkgs", "type": "github" } @@ -364,11 +364,11 @@ }, "nixpkgs_3": { "locked": { - "lastModified": 1720031269, - "narHash": "sha256-rwz8NJZV+387rnWpTYcXaRNvzUSnnF9aHONoJIYmiUQ=", + "lastModified": 1730785428, + "narHash": "sha256-Zwl8YgTVJTEum+L+0zVAWvXAGbWAuXHax3KzuejaDyo=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "9f4128e00b0ae8ec65918efeba59db998750ead6", + "rev": "4aa36568d413aca0ea84a1684d2d46f55dbabad7", "type": "github" }, "original": { @@ -574,11 +574,11 @@ "nixpkgs-stable": "nixpkgs-stable_3" }, "locked": { - "lastModified": 1719259945, - "narHash": "sha256-F1h+XIsGKT9TkGO3omxDLEb/9jOOsI6NnzsXFsZhry4=", + "lastModified": 1730814269, + "narHash": "sha256-fWPHyhYE6xvMI1eGY3pwBTq85wcy1YXqdzTZF+06nOg=", "owner": "cachix", "repo": "pre-commit-hooks.nix", - "rev": "0ff4381bbb8f7a52ca4a851660fc7a437a4c6e07", + "rev": "d70155fdc00df4628446352fc58adc640cd705c2", "type": "github" }, "original": { diff --git a/flake.nix b/flake.nix index bc6b150a..36ba5dd5 100644 --- a/flake.nix +++ b/flake.nix @@ -29,7 +29,7 @@ inputs = { flake-compat.follows = "flake-compat"; flake-utils.follows = "flake-utils"; - }; + }; }; }; outputs = { @@ -75,20 +75,34 @@ cabal2nixOptions = "--benchmark -fdev"; # https://github.com/tweag/monad-bayes/pull/256: Don't run tests on Mac because of machine precision issues - modifier = drv: if system == "x86_64-linux" then drv else pkgs.haskell.lib.dontCheck drv; - overrides = self: super: with pkgs.haskell.lib; { # Please check after flake.lock updates whether some of these overrides can be removed - brick = super.brick_2_3_1; - }; + modifier = drv: + if system == "x86_64-linux" + then drv + else pkgs.haskell.lib.dontCheck drv; + overrides = self: super: + with pkgs.haskell.lib; + { + # Please check after flake.lock updates whether some of these overrides can be removed + brick = super.brick_2_4; + } + // lib.optionalAttrs (lib.versionAtLeast super.ghc.version "9.10") { + # Please check after flake.lock updates whether some of these overrides can be removed + microstache = doJailbreak super.microstache; + }; }; - ghcs = [ # Always keep this up to date with the tested-with section in monad-bayes.cabal! + ghcs = [ + # Always keep this up to date with the tested-with section in monad-bayes.cabal, + # and the build-all-ghcs job in .github/workflows/nix.yml! "ghc902" "ghc927" "ghc945" "ghc964" "ghc982" + "ghc9101" ]; buildForVersion = ghcVersion: (builtins.getAttr ghcVersion pkgs.haskell.packages).developPackage opts; - in lib.attrsets.genAttrs ghcs buildForVersion; + in + lib.attrsets.genAttrs ghcs buildForVersion; monad-bayes = monad-bayes-per-ghc.ghc902; diff --git a/monad-bayes.cabal b/monad-bayes.cabal index 80dc38ad..42b8dce5 100644 --- a/monad-bayes.cabal +++ b/monad-bayes.cabal @@ -1,13 +1,15 @@ cabal-version: 2.2 name: monad-bayes -version: 1.3.0.2 +version: 1.3.0.3 license: MIT license-file: LICENSE.md copyright: 2015-2020 Adam Scibior maintainer: dominic.steinitz@tweag.io author: Adam Scibior stability: experimental -tested-with: GHC ==9.0.2 || ==9.2.7 || ==9.4.5 || ==9.6.4 || ==9.8.2 +tested-with: + GHC ==9.0.2 || ==9.2.7 || ==9.4.5 || ==9.6.4 || ==9.8.2 || ==9.10.1 + homepage: http://github.com/tweag/monad-bayes#readme bug-reports: https://github.com/tweag/monad-bayes/issues synopsis: A library for probabilistic programming. @@ -38,9 +40,9 @@ flag dev common deps build-depends: - , base >=4.15 && <4.20 - , brick >=2.3.1 && <2.5 - , containers >=0.5.10 && <0.7 + , base >=4.15 && <4.21 + , brick >=2.3.1 && <2.6 + , containers >=0.6 && <0.8 , foldl ^>=1.4 , free ^>=5.2 , histogram-fill ^>=0.9 @@ -71,14 +73,14 @@ common deps common test-deps build-depends: , abstract-par ^>=0.3 - , criterion >=1.5 && <1.7 + , criterion >=1.5 && <1.7 , directory ^>=1.3 - , hspec >=2.10 && <2.12 + , hspec >=2.10 && <2.12 , monad-bayes - , optparse-applicative >=0.17 && <0.19 + , optparse-applicative >=0.17 && <0.19 , process ^>=1.6 - , QuickCheck ^>=2.14 - , time >=1.9 && <1.13 + , QuickCheck >=2.14 && <2.16 + , time >=1.9 && <1.13 , typed-process ^>=0.2 autogen-modules: Paths_monad_bayes diff --git a/src/Control/Monad/Bayes/Integrator.hs b/src/Control/Monad/Bayes/Integrator.hs index 0c1cf5c9..ab41743a 100644 --- a/src/Control/Monad/Bayes/Integrator.hs +++ b/src/Control/Monad/Bayes/Integrator.hs @@ -42,7 +42,7 @@ import Control.Monad.Cont cont, runCont, ) -import Data.Foldable (Foldable (foldl')) +import Data.Foldable (Foldable (..)) import Data.Set (Set, elems) import Numeric.Integration.TanhSinh (Result (result), trap) import Numeric.Log (Log (ln)) @@ -51,7 +51,7 @@ import Statistics.Distribution.Uniform qualified as Statistics -- Prelude exports liftA2 from GHC 9.6 on, see https://github.com/haskell/core-libraries-committee/blob/main/guides/export-lifta2-prelude.md -- import Control.Applicative further up can be removed once we don't support GHC <= 9.4 anymore -import Prelude hiding (Applicative (..)) +import Prelude hiding (Applicative (..), Foldable (..)) newtype Integrator a = Integrator {getIntegrator :: Cont Double a} deriving newtype (Functor, Applicative, Monad)