diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 13c57c10..2792da70 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -24,26 +24,26 @@ jobs: ~/.cabal/packages ~/.cabal/store dist-newstyle - key: cabal-deps-${{ runner.os }}-${{ hashFiles('nix/sources.json') }}-${{ matrix.ghc-version }}-v${{ env.cache-invalidation-key }}-${{ hashFiles('linear-base.cabal') }}-${{ github.sha }} - restore-keys: cabal-deps-${{ runner.os }}-${{ hashFiles('nix/sources.json') }}-${{ matrix.ghc-version }}-v${{ env.cache-invalidation-key }}-${{ hashFiles('linear-base.cabal') }}- + key: cabal-deps-${{ runner.os }}-${{ hashFiles('flake.lock') }}-${{ matrix.ghc-version }}-v${{ env.cache-invalidation-key }}-${{ hashFiles('linear-base.cabal') }}-${{ github.sha }} + restore-keys: cabal-deps-${{ runner.os }}-${{ hashFiles('flake.lock') }}-${{ matrix.ghc-version }}-v${{ env.cache-invalidation-key }}-${{ hashFiles('linear-base.cabal') }}- - name: Build Nix dependencies - run: nix-shell --arg ghcVersion '"${{ matrix.ghc-version }}"' --arg installHls 'false' --pure --run "echo '=== Nix dependencies installed ==='" + run: nix develop .#devShells.x86_64-linux.ci-"${{ matrix.ghc-version }}" --command echo '=== Nix dependencies installed ===' - name: Init Cabal's config file - run: nix-shell --arg ghcVersion '"${{ matrix.ghc-version }}"' --arg installHls 'false' --pure --run "cabal --config-file=/home/runner/.cabal/config user-config -f init" + run: nix develop .#devShells.x86_64-linux.ci-"${{ matrix.ghc-version }}" --command cabal --config-file=/home/runner/.cabal/config user-config -f init - name: Update Cabal's database - run: nix-shell --arg ghcVersion '"${{ matrix.ghc-version }}"' --arg installHls 'false' --pure --run "cabal update" + run: nix develop .#devShells.x86_64-linux.ci-"${{ matrix.ghc-version }}" --command cabal update - name: Build Cabal's dependencies - run: nix-shell --arg ghcVersion '"${{ matrix.ghc-version }}"' --arg installHls 'false' --pure --run "cabal build --dependencies-only" + run: nix develop .#devShells.x86_64-linux.ci-"${{ matrix.ghc-version }}" --command cabal build --dependencies-only - name: Build - run: nix-shell --arg ghcVersion '"${{ matrix.ghc-version }}"' --arg installHls 'false' --pure --run "cabal build" + run: nix develop .#devShells.x86_64-linux.ci-"${{ matrix.ghc-version }}" --command cabal build - name: Haddock - run: nix-shell --arg ghcVersion '"${{ matrix.ghc-version }}"' --arg installHls 'false' --pure --run "cabal haddock" + run: nix develop .#devShells.x86_64-linux.ci-"${{ matrix.ghc-version }}" --command cabal haddock - name: cabal-docspec - run: nix-shell --arg ghcVersion '"${{ matrix.ghc-version }}"' --arg installHls 'false' --pure --run "cabal-docspec" + run: nix develop .#devShells.x86_64-linux.ci-"${{ matrix.ghc-version }}" --command cabal-docspec - name: Build benchmarks - run: nix-shell --arg ghcVersion '"${{ matrix.ghc-version }}"' --arg installHls 'false' --pure --run "cabal build linear-base:bench:bench" + run: nix develop .#devShells.x86_64-linux.ci-"${{ matrix.ghc-version }}" --command cabal build linear-base:bench:bench - name: Run benchmarks - run: nix-shell --arg ghcVersion '"${{ matrix.ghc-version }}"' --arg installHls 'false' --pure --run "cabal bench 2>&1 | tee benchmark_ghc${{ matrix.ghc-version }}.txt" + run: nix develop .#devShells.x86_64-linux.ci-"${{ matrix.ghc-version }}" --command cabal bench 2>&1 | tee benchmark_ghc${{ matrix.ghc-version }}.txt - name: Upload benchmark results uses: actions/upload-artifact@v4 with: @@ -60,16 +60,10 @@ jobs: - uses: cachix/install-nix-action@v15 with: nix_path: "${{ env.nixpkgs-url }}" - - name: Cache Stack dependencies - uses: actions/cache@v4 - with: - path: ~/.stack - key: stack-deps-ormolu-${{ runner.os }}-${{ hashFiles('nix/sources.json') }}-v${{ env.cache-invalidation-key }}-${{ hashFiles('stack.yaml.lock') }}-${{ github.sha }} - restore-keys: stack-deps-ormolu-${{ runner.os }}-${{ hashFiles('nix/sources.json') }}-v${{ env.cache-invalidation-key }}-${{ hashFiles('stack.yaml.lock') }}- - name: Build Nix dependencies - run: nix-shell --arg installHls 'false' --pure --run "echo '=== Nix dependencies installed ==='" + run: nix develop .#devShells.x86_64-linux.ci-stack --command echo '=== Nix dependencies installed ===' - name: check formatting - run: nix-shell --arg installHls 'false' --pure --run 'stack build ormolu && stack exec ormolu -- -m check $(find . -type f -name "*.hs-boot" -o -name "*.hs")' + run: nix develop .#devShells.x86_64-linux.ci-stack --command ormolu -m check $(find . -type f -name "*.hs-boot" -o -name "*.hs") stack-build: name: stack build @@ -83,9 +77,9 @@ jobs: uses: actions/cache@v4 with: path: ~/.stack - key: stack-deps-${{ runner.os }}-${{ hashFiles('nix/sources.json') }}-v${{ env.cache-invalidation-key }}-${{ hashFiles('stack.yaml.lock', 'linear-base.cabal') }}-${{ github.sha }} - restore-keys: stack-deps-${{ runner.os }}-${{ hashFiles('nix/sources.json') }}-v${{ env.cache-invalidation-key }}-${{ hashFiles('stack.yaml.lock', 'linear-base.cabal') }}- + key: stack-deps-${{ runner.os }}-${{ hashFiles('flake.lock') }}-v${{ env.cache-invalidation-key }}-${{ hashFiles('stack.yaml.lock', 'linear-base.cabal') }}-${{ github.sha }} + restore-keys: stack-deps-${{ runner.os }}-${{ hashFiles('flake.lock') }}-v${{ env.cache-invalidation-key }}-${{ hashFiles('stack.yaml.lock', 'linear-base.cabal') }}- - name: Build Nix dependencies - run: nix-shell --arg installHls 'false' --pure --run "echo '=== Nix dependencies installed ==='" + run: nix develop .#devShells.x86_64-linux.ci-stack --command echo '=== Nix dependencies installed ===' - name: Build - run: nix-shell --arg installHls 'false' --pure --run "stack build --pedantic --test --bench --no-run-benchmarks" + run: nix develop .#devShells.x86_64-linux.ci-stack --command stack build --pedantic --test --bench --no-run-benchmarks diff --git a/bench/Data/Mutable/HashMap.hs b/bench/Data/Mutable/HashMap.hs index b3e914b4..321dde15 100644 --- a/bench/Data/Mutable/HashMap.hs +++ b/bench/Data/Mutable/HashMap.hs @@ -22,7 +22,7 @@ import qualified Data.HashMap.Strict as Map import qualified Data.HashTable.ST.Basic as BasicST import qualified Data.HashTable.ST.Cuckoo as CuckooST import Data.Hashable (Hashable (..), hashWithSalt) -import Data.List (foldl') +import qualified Data.List as List import qualified Data.Unrestricted.Linear as Linear import GHC.Generics (Generic) import qualified Prelude.Linear as Linear @@ -199,7 +199,7 @@ vanilla_hashmap_strict inp@(BenchInput {pairs = kvs}) = bench (descriptions !! n) $ nf (\xs -> f xs Map.empty) kvs foldlx :: (b -> a -> b) -> [a] -> b -> b - foldlx f xs b = foldl' f b xs + foldlx f xs b = List.foldl' f b xs look :: Map.HashMap Key Int -> Key -> Map.HashMap Key Int look m k = case m Map.!? k of @@ -208,7 +208,7 @@ vanilla_hashmap_strict inp@(BenchInput {pairs = kvs}) = bench1 :: Benchmark bench1 = mkBench 0 $ - \xs hm -> foldl' (\m (k, v) -> Map.delete k (Map.insert k v m)) hm xs + \xs hm -> List.foldl' (\m (k, v) -> Map.delete k (Map.insert k v m)) hm xs bench2 :: Benchmark bench2 = mkBench 1 $ diff --git a/cabal.project b/cabal.project index f416fef5..35c833a6 100644 --- a/cabal.project +++ b/cabal.project @@ -3,4 +3,4 @@ packages: *.cabal tests: True benchmarks: True allow-newer: all -index-state: 2024-09-13T13:31:57Z +index-state: 2026-05-12T09:26:21Z diff --git a/flake.lock b/flake.lock new file mode 100644 index 00000000..e9e04e40 --- /dev/null +++ b/flake.lock @@ -0,0 +1,61 @@ +{ + "nodes": { + "flake-utils": { + "inputs": { + "systems": "systems" + }, + "locked": { + "lastModified": 1731533236, + "narHash": "sha256-l0KFg5HjrsfsO/JpG+r7fRrqm12kzFHyUHqHCVpMMbI=", + "owner": "numtide", + "repo": "flake-utils", + "rev": "11707dc2f618dd54ca8739b309ec4fc024de578b", + "type": "github" + }, + "original": { + "owner": "numtide", + "repo": "flake-utils", + "type": "github" + } + }, + "nixpkgs": { + "locked": { + "lastModified": 1778458615, + "narHash": "sha256-cY07EsdhBJ8tFXPzDYevgqxRev9ZLxFonuq9wmq5kwg=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "c6e5ca3c836a5f4dd9af9f2c1fc1c38f0fac988a", + "type": "github" + }, + "original": { + "owner": "NixOS", + "ref": "nixpkgs-unstable", + "repo": "nixpkgs", + "type": "github" + } + }, + "root": { + "inputs": { + "flake-utils": "flake-utils", + "nixpkgs": "nixpkgs" + } + }, + "systems": { + "locked": { + "lastModified": 1681028828, + "narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=", + "owner": "nix-systems", + "repo": "default", + "rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e", + "type": "github" + }, + "original": { + "owner": "nix-systems", + "repo": "default", + "type": "github" + } + } + }, + "root": "root", + "version": 7 +} diff --git a/flake.nix b/flake.nix new file mode 100644 index 00000000..5a39915d --- /dev/null +++ b/flake.nix @@ -0,0 +1,86 @@ +{ + description = "Linear-base"; + + inputs.nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable"; + inputs.flake-utils.url = "github:numtide/flake-utils"; + + outputs = { self, nixpkgs, flake-utils }: + flake-utils.lib.eachDefaultSystem (system: + let + pkgs = import nixpkgs { inherit system; inherit overlays; }; + + # need to match Stackage LTS version from stack.yaml snapshot + stack-ghc-version = "ghc9103"; + + # Versions used by CI's Cabal-based matrix + ci-ghc-versions = ["96" "98" "910" "912"]; + + cabal-docspec = import ./nix/cabal-docspec.nix { inherit pkgs; }; + + buildTools = ghc-ver: + let hask = pkgs.haskell.packages."${ghc-ver}"; in + [ + hask.ghc + pkgs.cabal-install + stack-wrapped + cabal-docspec + pkgs.ormolu # Haskell formatter + ]; + + devTools = ghc-ver: + let hask = pkgs.haskell.packages."${ghc-ver}"; in + [ + hask.ghcid # Continuous terminal Haskell compile checker + hask.haskell-language-server # LSP server for editor + ]; + + mkCIShellFor = ghc-ver: pkgs.mkShell { + # Set UTF-8 local so that run-tests can parse GHC's unicode output. + LANG="C.UTF-8"; + + buildInputs = buildTools "${ghc-ver}"; + }; + + ci-shells = builtins.listToAttrs (map (ver: + { name = "ci-${ver}"; value = mkCIShellFor "ghc${ver}"; } + ) ci-ghc-versions); + + mkDevShellFor = ghc-ver: pkgs.mkShell { + # Set UTF-8 local so that run-tests can parse GHC's unicode output. + LANG="C.UTF-8"; + + buildInputs = buildTools "${ghc-ver}" ++ devTools "${ghc-ver}"; + + }; + + cabal-dev-shells = builtins.listToAttrs (map (ver: + { name = "dev-${ver}"; value = mkDevShellFor "ghc${ver}"; } + ) ci-ghc-versions); + + # See https://docs.haskellstack.org/en/stable/topics/nix_integration/ + stack-wrapped = pkgs.symlinkJoin { + name = "stack"; # will be available as the usual `stack` in terminal + paths = [ pkgs.stack ]; + buildInputs = [ pkgs.makeWrapper ]; + postBuild = '' + wrapProgram $out/bin/stack \ + --add-flags "\ + --no-nix \ + --system-ghc \ + --no-install-ghc \ + " + ''; + }; + + overlays = [ + ]; + + in { + + devShells = ci-shells // cabal-dev-shells // { + default = mkDevShellFor stack-ghc-version; + + ci-stack = mkCIShellFor stack-ghc-version;}; + } + ); +} diff --git a/format.sh b/format.sh index 24538b65..0203b267 100755 --- a/format.sh +++ b/format.sh @@ -1,14 +1,10 @@ #!/usr/bin/env bash -# Format linear-base using the version of Ormolu specified in stack.yaml. +# Format linear-base using the version of Ormolu from the PATH. It's recommended +# using the version provided by `flake.nix`, since it's the one used by the CI +# to enforce formatting. set -e export LANG="C.UTF-8" -stack build ormolu -## We can't format cabal at the moment because `cabal format` inlines -## common stanzas, which is very much something that we don't want. See -## https://github.com/haskell/cabal/issues/5734 -# -# cabal format -stack exec ormolu -- -m inplace $(find . -type f -name "*.hs-boot" -o -name "*.hs") +ormolu -m inplace $(find . -type f -name "*.hs-boot" -o -name "*.hs") diff --git a/nix/shell-stack.nix b/nix/shell-stack.nix deleted file mode 100644 index 109e10d6..00000000 --- a/nix/shell-stack.nix +++ /dev/null @@ -1,9 +0,0 @@ -# Provide Nix support to Stack by expressing system packages required, rather than manually having to install stuff like Zlib -# Inspired by https://docs.haskellstack.org/en/stable/nix_integration/#using-a-custom-shellnix-file -{ ghc, system ? builtins.currentSystem, sources ? import ./sources.nix, pkgs ? import sources.nixpkgs { inherit system; } }: - -pkgs.haskell.lib.buildStackProject { - inherit ghc; - name = "linear-base"; - buildInputs = [ ]; -} diff --git a/nix/sources.json b/nix/sources.json deleted file mode 100644 index 087becc5..00000000 --- a/nix/sources.json +++ /dev/null @@ -1,26 +0,0 @@ -{ - "niv": { - "branch": "master", - "description": "Easy dependency management for Nix projects", - "homepage": "https://github.com/nmattia/niv", - "owner": "nmattia", - "repo": "niv", - "rev": "dd678782cae74508d6b4824580d2b0935308011e", - "sha256": "0dk8dhh9vla2s409anmrfkva6h3r32xmz3cm8ha09wyk8iyf1f87", - "type": "tarball", - "url": "https://github.com/nmattia/niv/archive/dd678782cae74508d6b4824580d2b0935308011e.tar.gz", - "url_template": "https://github.com///archive/.tar.gz" - }, - "nixpkgs": { - "branch": "master", - "description": "Nix Packages collection", - "homepage": "https://github.com/NixOS/nixpkgs", - "owner": "NixOS", - "repo": "nixpkgs", - "rev": "0c501072d51fca9fc0f9fd123e106ad2f89c6b09", - "sha256": "0xmhs479g1gzqv320zlmx44wzqlnb741kp6zwj1m3nzzdv94v472", - "type": "tarball", - "url": "https://github.com/NixOS/nixpkgs/archive/0c501072d51fca9fc0f9fd123e106ad2f89c6b09.tar.gz", - "url_template": "https://github.com///archive/.tar.gz" - } -} diff --git a/nix/sources.nix b/nix/sources.nix deleted file mode 100644 index fe3dadf7..00000000 --- a/nix/sources.nix +++ /dev/null @@ -1,198 +0,0 @@ -# This file has been generated by Niv. - -let - - # - # The fetchers. fetch_ fetches specs of type . - # - - fetch_file = pkgs: name: spec: - let - name' = sanitizeName name + "-src"; - in - if spec.builtin or true then - builtins_fetchurl { inherit (spec) url sha256; name = name'; } - else - pkgs.fetchurl { inherit (spec) url sha256; name = name'; }; - - fetch_tarball = pkgs: name: spec: - let - name' = sanitizeName name + "-src"; - in - if spec.builtin or true then - builtins_fetchTarball { name = name'; inherit (spec) url sha256; } - else - pkgs.fetchzip { name = name'; inherit (spec) url sha256; }; - - fetch_git = name: spec: - let - ref = - spec.ref or ( - if spec ? branch then "refs/heads/${spec.branch}" else - if spec ? tag then "refs/tags/${spec.tag}" else - abort "In git source '${name}': Please specify `ref`, `tag` or `branch`!" - ); - submodules = spec.submodules or false; - submoduleArg = - let - nixSupportsSubmodules = builtins.compareVersions builtins.nixVersion "2.4" >= 0; - emptyArgWithWarning = - if submodules - then - builtins.trace - ( - "The niv input \"${name}\" uses submodules " - + "but your nix's (${builtins.nixVersion}) builtins.fetchGit " - + "does not support them" - ) - { } - else { }; - in - if nixSupportsSubmodules - then { inherit submodules; } - else emptyArgWithWarning; - in - builtins.fetchGit - ({ url = spec.repo; inherit (spec) rev; inherit ref; } // submoduleArg); - - fetch_local = spec: spec.path; - - fetch_builtin-tarball = name: throw - ''[${name}] The niv type "builtin-tarball" is deprecated. You should instead use `builtin = true`. - $ niv modify ${name} -a type=tarball -a builtin=true''; - - fetch_builtin-url = name: throw - ''[${name}] The niv type "builtin-url" will soon be deprecated. You should instead use `builtin = true`. - $ niv modify ${name} -a type=file -a builtin=true''; - - # - # Various helpers - # - - # https://github.com/NixOS/nixpkgs/pull/83241/files#diff-c6f540a4f3bfa4b0e8b6bafd4cd54e8bR695 - sanitizeName = name: - ( - concatMapStrings (s: if builtins.isList s then "-" else s) - ( - builtins.split "[^[:alnum:]+._?=-]+" - ((x: builtins.elemAt (builtins.match "\\.*(.*)" x) 0) name) - ) - ); - - # The set of packages used when specs are fetched using non-builtins. - mkPkgs = sources: system: - let - sourcesNixpkgs = - import (builtins_fetchTarball { inherit (sources.nixpkgs) url sha256; }) { inherit system; }; - hasNixpkgsPath = builtins.any (x: x.prefix == "nixpkgs") builtins.nixPath; - hasThisAsNixpkgsPath = == ./.; - in - if builtins.hasAttr "nixpkgs" sources - then sourcesNixpkgs - else if hasNixpkgsPath && ! hasThisAsNixpkgsPath then - import { } - else - abort - '' - Please specify either (through -I or NIX_PATH=nixpkgs=...) or - add a package called "nixpkgs" to your sources.json. - ''; - - # The actual fetching function. - fetch = pkgs: name: spec: - - if ! builtins.hasAttr "type" spec then - abort "ERROR: niv spec ${name} does not have a 'type' attribute" - else if spec.type == "file" then fetch_file pkgs name spec - else if spec.type == "tarball" then fetch_tarball pkgs name spec - else if spec.type == "git" then fetch_git name spec - else if spec.type == "local" then fetch_local spec - else if spec.type == "builtin-tarball" then fetch_builtin-tarball name - else if spec.type == "builtin-url" then fetch_builtin-url name - else - abort "ERROR: niv spec ${name} has unknown type ${builtins.toJSON spec.type}"; - - # If the environment variable NIV_OVERRIDE_${name} is set, then use - # the path directly as opposed to the fetched source. - replace = name: drv: - let - saneName = stringAsChars (c: if (builtins.match "[a-zA-Z0-9]" c) == null then "_" else c) name; - ersatz = builtins.getEnv "NIV_OVERRIDE_${saneName}"; - in - if ersatz == "" then drv else - # this turns the string into an actual Nix path (for both absolute and - # relative paths) - if builtins.substring 0 1 ersatz == "/" then /. + ersatz else /. + builtins.getEnv "PWD" + "/${ersatz}"; - - # Ports of functions for older nix versions - - # a Nix version of mapAttrs if the built-in doesn't exist - mapAttrs = builtins.mapAttrs or ( - f: set: with builtins; - listToAttrs (map (attr: { name = attr; value = f attr set.${attr}; }) (attrNames set)) - ); - - # https://github.com/NixOS/nixpkgs/blob/0258808f5744ca980b9a1f24fe0b1e6f0fecee9c/lib/lists.nix#L295 - range = first: last: if first > last then [ ] else builtins.genList (n: first + n) (last - first + 1); - - # https://github.com/NixOS/nixpkgs/blob/0258808f5744ca980b9a1f24fe0b1e6f0fecee9c/lib/strings.nix#L257 - stringToCharacters = s: map (p: builtins.substring p 1 s) (range 0 (builtins.stringLength s - 1)); - - # https://github.com/NixOS/nixpkgs/blob/0258808f5744ca980b9a1f24fe0b1e6f0fecee9c/lib/strings.nix#L269 - stringAsChars = f: s: concatStrings (map f (stringToCharacters s)); - concatMapStrings = f: list: concatStrings (map f list); - concatStrings = builtins.concatStringsSep ""; - - # https://github.com/NixOS/nixpkgs/blob/8a9f58a375c401b96da862d969f66429def1d118/lib/attrsets.nix#L331 - optionalAttrs = cond: as: if cond then as else { }; - - # fetchTarball version that is compatible between all the versions of Nix - builtins_fetchTarball = { url, name ? null, sha256 }@attrs: - let - inherit (builtins) lessThan nixVersion fetchTarball; - in - if lessThan nixVersion "1.12" then - fetchTarball ({ inherit url; } // (optionalAttrs (name != null) { inherit name; })) - else - fetchTarball attrs; - - # fetchurl version that is compatible between all the versions of Nix - builtins_fetchurl = { url, name ? null, sha256 }@attrs: - let - inherit (builtins) lessThan nixVersion fetchurl; - in - if lessThan nixVersion "1.12" then - fetchurl ({ inherit url; } // (optionalAttrs (name != null) { inherit name; })) - else - fetchurl attrs; - - # Create the final "sources" from the config - mkSources = config: - mapAttrs - ( - name: spec: - if builtins.hasAttr "outPath" spec - then - abort - "The values in sources.json should not have an 'outPath' attribute" - else - spec // { outPath = replace name (fetch config.pkgs name spec); } - ) - config.sources; - - # The "config" used by the fetchers - mkConfig = - { sourcesFile ? if builtins.pathExists ./sources.json then ./sources.json else null - , sources ? if sourcesFile == null then { } else builtins.fromJSON (builtins.readFile sourcesFile) - , system ? builtins.currentSystem - , pkgs ? mkPkgs sources system - }: rec { - # The sources, i.e. the attribute set of spec name to spec - inherit sources; - - # The "pkgs" (evaluated nixpkgs) to use for e.g. non-builtin fetchers - inherit pkgs; - }; - -in -mkSources (mkConfig { }) // { __functor = _: settings: mkSources (mkConfig settings); } diff --git a/shell.nix b/shell.nix deleted file mode 100644 index e703f76f..00000000 --- a/shell.nix +++ /dev/null @@ -1,36 +0,0 @@ -{ system ? builtins.currentSystem, sources ? import ./nix/sources.nix, ghcVersion ? "96", installHls ? true }: - -let - selectHls = self: super: { - haskell-language-server = super.haskell-language-server.override { supportedGhcVersions = [ "${ghcVersion}" ]; }; - }; - pkgs = import sources.nixpkgs { inherit system; overlays = [ selectHls ]; }; - cabal-docspec = import ./nix/cabal-docspec.nix { inherit pkgs; }; - stack-wrapped = pkgs.symlinkJoin { - name = "stack"; - paths = [ pkgs.stack ]; - buildInputs = [ pkgs.makeWrapper ]; - postBuild = '' - wrapProgram $out/bin/stack \ - --add-flags "\ - --nix \ - --nix-path=\\"nixpkgs=${pkgs.path}\\" - --nix-shell-file nix/shell-stack.nix \ - " - ''; - }; -in with pkgs; - -mkShell { - # Set UTF-8 local so that run-tests can parse GHC's unicode output. - LANG="C.UTF-8"; - NIX_PATH = "nixpkgs=${pkgs.path}"; - - buildInputs = [ - haskell.compiler."ghc${ghcVersion}" - cabal-install - stack-wrapped - nix - cabal-docspec - ] ++ (if installHls then [ haskell-language-server ] else []); -} diff --git a/stack.yaml b/stack.yaml index 790b9413..af03a6da 100644 --- a/stack.yaml +++ b/stack.yaml @@ -1,4 +1,4 @@ -resolver: lts-22.34 +resolver: lts-24.40 packages: - '.' extra-deps: diff --git a/stack.yaml.lock b/stack.yaml.lock index 401a580e..a5d75184 100644 --- a/stack.yaml.lock +++ b/stack.yaml.lock @@ -1,12 +1,12 @@ # This file was autogenerated by Stack. # You should not edit this file by hand. # For more information, please see the documentation at: -# https://docs.haskellstack.org/en/stable/lock_files +# https://docs.haskellstack.org/en/stable/topics/lock_files packages: [] snapshots: - completed: - sha256: edbd50d7e7c85c13ad5f5835ae2db92fab1e9cf05ecf85340e2622ec0a303df1 - size: 720020 - url: https://raw.githubusercontent.com/commercialhaskell/stackage-snapshots/master/lts/22/34.yaml - original: lts-22.34 + sha256: 514c8048a143da1e6f2c18484467d2136033a0b94b6617fe333089817edbbc27 + size: 729000 + url: https://raw.githubusercontent.com/commercialhaskell/stackage-snapshots/master/lts/24/40.yaml + original: lts-24.40 diff --git a/test/Test/Data/List.hs b/test/Test/Data/List.hs index a9d6f2d0..528e680c 100644 --- a/test/Test/Data/List.hs +++ b/test/Test/Data/List.hs @@ -1,5 +1,6 @@ {-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE NoImplicitPrelude #-} +{-# OPTIONS_GHC -Wno-x-partial #-} module Test.Data.List (listTests) where