Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
41 changes: 14 additions & 27 deletions .github/workflows/haskell-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@
#
# For more information, see https://github.com/haskell-CI/haskell-ci
#
# version: 0.19.20250506
# version: 0.19.20250917
#
# REGENDATA ("0.19.20250506",["github","unordered-containers.cabal"])
# REGENDATA ("0.19.20250917",["github","unordered-containers.cabal"])
#
name: Haskell-CI
on:
Expand All @@ -20,6 +20,9 @@ on:
pull_request:
branches:
- master
merge_group:
branches:
- master
jobs:
linux:
name: Haskell-CI - Linux - ${{ matrix.compiler }}
Expand Down Expand Up @@ -72,41 +75,21 @@ jobs:
compilerVersion: 8.10.7
setup-method: ghcup
allow-failure: false
- compiler: ghc-8.8.4
compilerKind: ghc
compilerVersion: 8.8.4
setup-method: ghcup
allow-failure: false
- compiler: ghc-8.6.5
compilerKind: ghc
compilerVersion: 8.6.5
setup-method: ghcup
allow-failure: false
- compiler: ghc-8.4.4
compilerKind: ghc
compilerVersion: 8.4.4
setup-method: ghcup
allow-failure: false
- compiler: ghc-8.2.2
compilerKind: ghc
compilerVersion: 8.2.2
setup-method: ghcup
allow-failure: false
fail-fast: false
steps:
- name: apt-get install
run: |
apt-get update
apt-get install -y --no-install-recommends gnupg ca-certificates dirmngr curl git software-properties-common libtinfo5 libnuma-dev
apt-get install -y --no-install-recommends gnupg ca-certificates dirmngr curl git software-properties-common libtinfo5
- name: Install GHCup
run: |
mkdir -p "$HOME/.ghcup/bin"
curl -sL https://downloads.haskell.org/ghcup/0.1.50.1/x86_64-linux-ghcup-0.1.50.1 > "$HOME/.ghcup/bin/ghcup"
chmod a+x "$HOME/.ghcup/bin/ghcup"
- name: Install cabal-install
run: |
"$HOME/.ghcup/bin/ghcup" install cabal 3.14.2.0 || (cat "$HOME"/.ghcup/logs/*.* && false)
echo "CABAL=$HOME/.ghcup/bin/cabal-3.14.2.0 -vnormal+nowrap" >> "$GITHUB_ENV"
"$HOME/.ghcup/bin/ghcup" install cabal 3.16.0.0 || (cat "$HOME"/.ghcup/logs/*.* && false)
echo "CABAL=$HOME/.ghcup/bin/cabal-3.16.0.0 -vnormal+nowrap" >> "$GITHUB_ENV"
- name: Install GHC (GHCup)
if: matrix.setup-method == 'ghcup'
run: |
Expand Down Expand Up @@ -182,7 +165,7 @@ jobs:
chmod a+x $HOME/.cabal/bin/cabal-plan
cabal-plan --version
- name: checkout
uses: actions/checkout@v4
uses: actions/checkout@v5
with:
path: source
- name: initial cabal.project for sdist
Expand All @@ -207,7 +190,11 @@ jobs:
touch cabal.project.local
echo "packages: ${PKGDIR_unordered_containers}" >> cabal.project
echo "package unordered-containers" >> cabal.project
echo " ghc-options: -Werror=missing-methods" >> cabal.project
echo " ghc-options: -Werror=missing-methods -Werror=missing-fields" >> cabal.project
if [ $((HCNUMVER >= 90400)) -ne 0 ] ; then echo "package unordered-containers" >> cabal.project ; fi
if [ $((HCNUMVER >= 90400)) -ne 0 ] ; then echo " ghc-options: -Werror=unused-packages" >> cabal.project ; fi
if [ $((HCNUMVER >= 90000)) -ne 0 ] ; then echo "package unordered-containers" >> cabal.project ; fi
if [ $((HCNUMVER >= 90000)) -ne 0 ] ; then echo " ghc-options: -Werror=incomplete-patterns -Werror=incomplete-uni-patterns" >> cabal.project ; fi
cat >> cabal.project <<EOF
EOF
$HCPKG list --simple-output --names-only | perl -ne 'for (split /\s+/) { print "constraints: any.$_ installed\n" unless /^(binary|containers|unordered-containers)$/; }' >> cabal.project.local
Expand Down
4 changes: 0 additions & 4 deletions Data/HashMap/Internal.hs
Original file line number Diff line number Diff line change
Expand Up @@ -192,11 +192,7 @@ instance (NFData k, NFData v) => NFData (Leaf k v) where

-- | @since 0.2.17.0
instance (TH.Lift k, TH.Lift v) => TH.Lift (Leaf k v) where
#if MIN_VERSION_template_haskell(2,16,0)
liftTyped (L k v) = [|| L k $! v ||]
#else
lift (L k v) = [| L k $! v |]
#endif

-- | @since 0.2.14.0
instance NFData k => NFData1 (Leaf k) where
Expand Down
11 changes: 1 addition & 10 deletions Data/HashMap/Internal/Array.hs
Original file line number Diff line number Diff line change
Expand Up @@ -207,18 +207,13 @@ new _n@(I# n#) b =
new_ :: Int -> ST s (MArray s a)
new_ n = new n undefinedElem

-- | When 'Exts.shrinkSmallMutableArray#' is available, the returned array is the same as the array given, as it is shrunk in place.
-- Otherwise a copy is made.
-- | The returned array is the same as the array given, as it is shrunk in place.
shrink :: MArray s a -> Int -> ST s (MArray s a)
#if __GLASGOW_HASKELL__ >= 810
shrink mary _n@(I# n#) =
CHECK_GT("shrink", _n, (0 :: Int))
CHECK_LE("shrink", _n, (lengthM mary))
ST $ \s -> case Exts.shrinkSmallMutableArray# (unMArray mary) n# s of
s' -> (# s', mary #)
#else
shrink mary n = cloneM mary 0 n
#endif
{-# INLINE shrink #-}

singleton :: a -> Array a
Expand Down Expand Up @@ -516,11 +511,7 @@ fromList' n xs0 =

-- | @since 0.2.17.0
instance TH.Lift a => TH.Lift (Array a) where
#if MIN_VERSION_template_haskell(2,16,0)
liftTyped ar = [|| fromList' arlen arlist ||]
#else
lift ar = [| fromList' arlen arlist |]
#endif
where
arlen = length ar
arlist = toList ar
Expand Down
5 changes: 0 additions & 5 deletions Data/HashMap/Internal/Debug.hs
Original file line number Diff line number Diff line change
Expand Up @@ -35,11 +35,6 @@ import Data.Semigroup (Sum (..))

import qualified Data.HashMap.Internal.Array as A


#if !MIN_VERSION_base(4,11,0)
import Data.Semigroup (Semigroup (..))
#endif

data Validity k = Invalid (Error k) SubHashPath | Valid
deriving (Eq, Show)

Expand Down
3 changes: 0 additions & 3 deletions Data/HashMap/Internal/List.hs
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,6 @@ module Data.HashMap.Internal.List

import Data.List (sortBy)
import Data.Maybe (fromMaybe)
#if !MIN_VERSION_base(4,11,0)
import Data.Semigroup ((<>))
#endif

-- Note: previous implementation isPermutation = null (as // bs)
-- was O(n^2) too.
Expand Down
21 changes: 0 additions & 21 deletions tests/Regressions.hs
Original file line number Diff line number Diff line change
Expand Up @@ -29,12 +29,8 @@ import qualified Data.HashMap.Strict as HMS
import qualified Data.HashSet as HS
import qualified Test.Tasty as Tasty

#if MIN_VERSION_base(4,12,0)
-- nothunks requires base >= 4.12
#define HAVE_NOTHUNKS
import qualified Data.Foldable as Foldable
import NoThunks.Class (noThunksInValues)
#endif

issue32 :: Assertion
issue32 = assert $ isJust $ HMS.lookup 7 m'
Expand Down Expand Up @@ -141,7 +137,6 @@ issue254Strict = do
------------------------------------------------------------------------
-- Issue #379

#ifdef HAVE_NOTHUNKS

issue379Union :: Assertion
issue379Union = do
Expand All @@ -167,8 +162,6 @@ issue379StrictUnionWithKey = do
mThunkInfo <- noThunksInValues mempty (Foldable.toList u)
assert $ isNothing mThunkInfo

#endif

-- Another key type that always collides.
--
-- Note (sjakobi): The KC newtype of Int somehow can't be used to demonstrate
Expand Down Expand Up @@ -196,8 +189,6 @@ issue379LazyUnionWith = do
------------------------------------------------------------------------
-- Issue #381

#ifdef HAVE_NOTHUNKS

issue381mapMaybe :: Assertion
issue381mapMaybe = do
let m0 = HMS.fromList [(KC 1, 10), (KC 2, 20 :: Int)]
Expand All @@ -212,8 +203,6 @@ issue381mapMaybeWithKey = do
mThunkInfo <- noThunksInValues mempty (Foldable.toList m1)
assert $ isNothing mThunkInfo

#endif

------------------------------------------------------------------------
-- Issue #382

Expand All @@ -234,8 +223,6 @@ issue382 = do
------------------------------------------------------------------------
-- Issue #383

#ifdef HAVE_NOTHUNKS

-- Custom Functor to prevent interference from alterF rules
newtype MyIdentity a = MyIdentity a
instance Functor MyIdentity where
Expand All @@ -250,8 +237,6 @@ issue383 = do
mThunkInfo <- noThunksInValues mempty (Foldable.toList m)
assert $ isNothing mThunkInfo

#endif

------------------------------------------------------------------------
-- Issue #420

Expand Down Expand Up @@ -288,22 +273,16 @@ tests = testGroup "Regression tests"
, testCase "issue254 strict" issue254Strict
, testGroup "issue379"
[ testCase "Lazy.unionWith" issue379LazyUnionWith
#ifdef HAVE_NOTHUNKS
, testCase "union" issue379Union
, testCase "Strict.unionWith" issue379StrictUnionWith
, testCase "Strict.unionWithKey" issue379StrictUnionWithKey
#endif
]
#ifdef HAVE_NOTHUNKS
, testGroup "issue381"
[ testCase "mapMaybe" issue381mapMaybe
, testCase "mapMaybeWithKey" issue381mapMaybeWithKey
]
#endif
, testCase "issue382" issue382
#ifdef HAVE_NOTHUNKS
, testCase "issue383" issue383
#endif
, testCase "issue420" issue420
, issue491
]
18 changes: 4 additions & 14 deletions unordered-containers.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -37,10 +37,6 @@ tested-with:
|| ==9.2.8
|| ==9.0.2
|| ==8.10.7
|| ==8.8.4
|| ==8.6.5
|| ==8.4.4
|| ==8.2.2

flag debug
description: Enable debug support
Expand All @@ -59,10 +55,10 @@ library
Data.HashSet.Internal

build-depends:
base >= 4.10 && < 5,
base >= 4.14 && < 5,
deepseq >= 1.4.3,
hashable >= 1.4 && < 1.6,
template-haskell < 2.24
template-haskell >= 2.16 && < 2.24

default-language: Haskell2010

Expand Down Expand Up @@ -104,16 +100,13 @@ test-suite unordered-containers-tests
hashable,
HUnit,
QuickCheck >= 2.4.0.1,
nothunks >= 0.1.3,
random,
tasty >= 1.4.0.3,
tasty-hunit >= 0.10.0.3,
tasty-quickcheck >= 0.10.1.2,
unordered-containers

if impl(ghc >= 8.6)
build-depends:
nothunks >= 0.1.3

default-language: Haskell2010
ghc-options: -Wall -threaded -rtsopts -with-rtsopts=-N
cpp-options: -DASSERTS
Expand All @@ -135,15 +128,12 @@ benchmark benchmarks
deepseq,
hashable,
hashmap,
mtl,
random,
tasty-bench >= 0.3.1,
unordered-containers

default-language: Haskell2010
ghc-options: -Wall -O2 -rtsopts -with-rtsopts=-A32m
if impl(ghc >= 8.10)
ghc-options: "-with-rtsopts=-A32m --nonmoving-gc"
ghc-options: -Wall -O2 -rtsopts "-with-rtsopts=-A32m --nonmoving-gc"
-- cpp-options: -DBENCH_containers_Map -DBENCH_containers_IntMap -DBENCH_hashmap_Map

source-repository head
Expand Down