Skip to content

Commit

Permalink
Merge pull request #361 from tweag/dev_ghc_910
Browse files Browse the repository at this point in the history
Allow GHC 9.10
  • Loading branch information
turion authored Nov 10, 2024
2 parents 670eb3d + 72d8e4d commit 000ba4f
Show file tree
Hide file tree
Showing 6 changed files with 77 additions and 35 deletions.
28 changes: 25 additions & 3 deletions .github/workflows/nix.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
# 1.3.0.3

- Relaxed some version bounds

# 1.3.0.2

- Relaxed some version bounds
Expand Down
26 changes: 13 additions & 13 deletions flake.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

28 changes: 21 additions & 7 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
inputs = {
flake-compat.follows = "flake-compat";
flake-utils.follows = "flake-utils";
};
};
};
};
outputs = {
Expand Down Expand Up @@ -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;

Expand Down
22 changes: 12 additions & 10 deletions monad-bayes.cabal
Original file line number Diff line number Diff line change
@@ -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 <adscib@gmail.com>
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.
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions src/Control/Monad/Bayes/Integrator.hs
Original file line number Diff line number Diff line change
Expand Up @@ -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))
Expand All @@ -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)
Expand Down

0 comments on commit 000ba4f

Please sign in to comment.