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
39 changes: 18 additions & 21 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.20250605
# version: 0.19.20260104
#
# REGENDATA ("0.19.20250605",["github","cabal.project"])
# REGENDATA ("0.19.20260104",["github","cabal.project"])
#
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,16 +75,6 @@ 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
fail-fast: false
steps:
- name: apt-get install
Expand All @@ -95,8 +88,8 @@ jobs:
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 @@ -172,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 @@ -197,7 +190,11 @@ jobs:
touch cabal.project.local
echo "packages: ${PKGDIR_quickcheck_instances}" >> cabal.project
echo "package quickcheck-instances" >> 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 quickcheck-instances" >> 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 quickcheck-instances" >> 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
allow-newer: these:base
EOF
Expand Down Expand Up @@ -255,12 +252,12 @@ jobs:
if [ $((HCNUMVER < 90400)) -ne 0 ] ; then $CABAL v2-build $ARG_COMPILER --enable-tests --disable-benchmarks --constraint='text ^>=1.2.3.0' --dependencies-only -j2 all ; fi
if [ $((HCNUMVER < 90400)) -ne 0 ] ; then $CABAL v2-build $ARG_COMPILER --enable-tests --disable-benchmarks --constraint='text ^>=1.2.3.0' all ; fi
if [ $((HCNUMVER < 90400)) -ne 0 ] ; then $CABAL v2-test $ARG_COMPILER --enable-tests --disable-benchmarks --constraint='text ^>=1.2.3.0' all ; fi
- name: constraint set lower-bounds-8.6.5
- name: constraint set lower-bounds-8.10.7
run: |
if [ $((HCNUMVER < 80800)) -ne 0 ] ; then $CABAL v2-build $ARG_COMPILER --disable-tests --disable-benchmarks --constraint='QuickCheck ==2.14.2' --constraint='array ==0.5.3.0' --constraint='base ==4.12.0.0' --constraint='bytestring ==0.10.8.2' --constraint='case-insensitive ==1.2.0.11' --constraint='containers ==0.6.0.1' --constraint='hashable ==1.4.4.0' --constraint='old-time ==1.1.0.0' --constraint='OneTuple ==0.4.2' --constraint='scientific ==0.3.8.0' --constraint='primitive ==0.9.0.0' --constraint='strict ==0.5' --constraint='tagged ==0.8.8' --constraint='text ==1.2.3.0' --constraint='these ==1.2.1' --constraint='transformers ==0.5.6.2' --constraint='unordered-containers ==0.2.20' --constraint='uuid-types ==1.0.6' --constraint='vector ==0.13.2.0' all --dry-run ; fi
if [ $((HCNUMVER < 80800)) -ne 0 ] ; then cabal-plan topo | sort ; fi
if [ $((HCNUMVER < 80800)) -ne 0 ] ; then $CABAL v2-build $ARG_COMPILER --disable-tests --disable-benchmarks --constraint='QuickCheck ==2.14.2' --constraint='array ==0.5.3.0' --constraint='base ==4.12.0.0' --constraint='bytestring ==0.10.8.2' --constraint='case-insensitive ==1.2.0.11' --constraint='containers ==0.6.0.1' --constraint='hashable ==1.4.4.0' --constraint='old-time ==1.1.0.0' --constraint='OneTuple ==0.4.2' --constraint='scientific ==0.3.8.0' --constraint='primitive ==0.9.0.0' --constraint='strict ==0.5' --constraint='tagged ==0.8.8' --constraint='text ==1.2.3.0' --constraint='these ==1.2.1' --constraint='transformers ==0.5.6.2' --constraint='unordered-containers ==0.2.20' --constraint='uuid-types ==1.0.6' --constraint='vector ==0.13.2.0' --dependencies-only -j2 all ; fi
if [ $((HCNUMVER < 80800)) -ne 0 ] ; then $CABAL v2-build $ARG_COMPILER --disable-tests --disable-benchmarks --constraint='QuickCheck ==2.14.2' --constraint='array ==0.5.3.0' --constraint='base ==4.12.0.0' --constraint='bytestring ==0.10.8.2' --constraint='case-insensitive ==1.2.0.11' --constraint='containers ==0.6.0.1' --constraint='hashable ==1.4.4.0' --constraint='old-time ==1.1.0.0' --constraint='OneTuple ==0.4.2' --constraint='scientific ==0.3.8.0' --constraint='primitive ==0.9.0.0' --constraint='strict ==0.5' --constraint='tagged ==0.8.8' --constraint='text ==1.2.3.0' --constraint='these ==1.2.1' --constraint='transformers ==0.5.6.2' --constraint='unordered-containers ==0.2.20' --constraint='uuid-types ==1.0.6' --constraint='vector ==0.13.2.0' all ; fi
if [ $((HCNUMVER < 90000)) -ne 0 ] ; then $CABAL v2-build $ARG_COMPILER --disable-tests --disable-benchmarks --constraint='QuickCheck ==2.17.1.0' --constraint='array ==0.5.4.0' --constraint='base ==4.14.3.0' --constraint='bytestring ==0.10.12.0' --constraint='case-insensitive ==1.2.0.11' --constraint='hashable ==1.4.4.0' --constraint='old-time ==1.1.0.0' --constraint='OneTuple ==0.4.2' --constraint='scientific ==0.3.8.0' --constraint='primitive ==0.9.0.0' --constraint='strict ==0.5' --constraint='tagged ==0.8.8' --constraint='text ==1.2.4.1' --constraint='these ==1.2.1' --constraint='transformers ==0.5.6.2' --constraint='unordered-containers ==0.2.20' --constraint='uuid-types ==1.0.6' --constraint='vector ==0.13.2.0' all --dry-run ; fi
if [ $((HCNUMVER < 90000)) -ne 0 ] ; then cabal-plan topo | sort ; fi
if [ $((HCNUMVER < 90000)) -ne 0 ] ; then $CABAL v2-build $ARG_COMPILER --disable-tests --disable-benchmarks --constraint='QuickCheck ==2.17.1.0' --constraint='array ==0.5.4.0' --constraint='base ==4.14.3.0' --constraint='bytestring ==0.10.12.0' --constraint='case-insensitive ==1.2.0.11' --constraint='hashable ==1.4.4.0' --constraint='old-time ==1.1.0.0' --constraint='OneTuple ==0.4.2' --constraint='scientific ==0.3.8.0' --constraint='primitive ==0.9.0.0' --constraint='strict ==0.5' --constraint='tagged ==0.8.8' --constraint='text ==1.2.4.1' --constraint='these ==1.2.1' --constraint='transformers ==0.5.6.2' --constraint='unordered-containers ==0.2.20' --constraint='uuid-types ==1.0.6' --constraint='vector ==0.13.2.0' --dependencies-only -j2 all ; fi
if [ $((HCNUMVER < 90000)) -ne 0 ] ; then $CABAL v2-build $ARG_COMPILER --disable-tests --disable-benchmarks --constraint='QuickCheck ==2.17.1.0' --constraint='array ==0.5.4.0' --constraint='base ==4.14.3.0' --constraint='bytestring ==0.10.12.0' --constraint='case-insensitive ==1.2.0.11' --constraint='hashable ==1.4.4.0' --constraint='old-time ==1.1.0.0' --constraint='OneTuple ==0.4.2' --constraint='scientific ==0.3.8.0' --constraint='primitive ==0.9.0.0' --constraint='strict ==0.5' --constraint='tagged ==0.8.8' --constraint='text ==1.2.4.1' --constraint='these ==1.2.1' --constraint='transformers ==0.5.6.2' --constraint='unordered-containers ==0.2.20' --constraint='uuid-types ==1.0.6' --constraint='vector ==0.13.2.0' all ; fi
- name: save cache
if: always()
uses: actions/cache/save@v4
Expand Down
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -11,3 +11,5 @@
.#*
\#*#
*~

cabal.project.local
6 changes: 6 additions & 0 deletions CHANGES
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
0.4

* Depend on QuickCheck-2.17.1.0
Drop instances for Natural, ByteArray, Solo, NonEmpty, Data.Semigroup.*
These should be now provided by QuickCheck package.

0.3.33

* Add instances for strict vectors
Expand Down
15 changes: 7 additions & 8 deletions cabal.haskell-ci
Original file line number Diff line number Diff line change
@@ -1,23 +1,22 @@
branches: master
head-hackage: False

constraint-set lower-bounds-8.6.5
ghc: ==8.6.5
constraint-set lower-bounds-8.10.7
ghc: ==8.10.7
constraints:
QuickCheck ==2.14.2,
array ==0.5.3.0,
base ==4.12.0.0,
bytestring ==0.10.8.2,
QuickCheck ==2.17.1.0,
array ==0.5.4.0,
base ==4.14.3.0,
bytestring ==0.10.12.0,
case-insensitive ==1.2.0.11,
containers ==0.6.0.1,
hashable ==1.4.4.0,
old-time ==1.1.0.0,
OneTuple ==0.4.2,
scientific ==0.3.8.0,
primitive ==0.9.0.0,
strict ==0.5,
tagged ==0.8.8,
text ==1.2.3.0,
text ==1.2.4.1,
these ==1.2.1,
transformers ==0.5.6.2,
unordered-containers ==0.2.20,
Expand Down
49 changes: 21 additions & 28 deletions quickcheck-instances.cabal
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
cabal-version: 2.2
name: quickcheck-instances
version: 0.3.33
x-revision: 1
version: 0.4
synopsis: Common quickcheck instances
description:
QuickCheck instances.
Expand All @@ -28,9 +27,7 @@ category: Testing
build-type: Simple
extra-source-files: CHANGES
tested-with:
GHC ==8.6.5
|| ==8.8.4
|| ==8.10.7
GHC ==8.10.7
|| ==9.0.2
|| ==9.2.8
|| ==9.4.8
Expand Down Expand Up @@ -82,31 +79,28 @@ library
hs-source-dirs: src
build-depends:
, base >=4.12.0.0 && <4.22
, QuickCheck >=2.14.2 && <2.16.1
, splitmix >=0.1.0.5 && <0.2
, QuickCheck >=2.17.1.0 && <2.17.2
, splitmix >=0.1.3.2 && <0.2

build-depends:
, array >=0.5.3.0 && <0.6
, bytestring >=0.10.8.2 && <0.13
, case-insensitive >=1.2.0.11 && <1.3
, containers >=0.6.0.1 && <0.8
, data-fix >=0.3 && <0.4
, hashable >=1.4.4.0 && <1.6
, array >=0.5.4.0 && <0.6
, bytestring >=0.10.12.0 && <0.13
, case-insensitive >=1.2.0.11 && <1.3
, data-fix >=0.3 && <0.4
, hashable >=1.4.4.0 && <1.6
, integer-logarithms >=1.0.3.1 && <1.1
, old-time >=1.1.0.0 && <1.2
, OneTuple >=0.4.2 && <0.5
, primitive >=0.9.0.0 && <0.10
, scientific >=0.3.8.0 && <0.4
, strict >=0.5 && <0.6
, tagged >=0.8.8 && <0.9
, text >=1.2.3.0 && <1.3 || >=2.0 && <2.2
, text-short >=0.1.4 && <0.2
, these >=1.2.1 && <1.3
, time-compat >=1.9.4 && <1.10
, transformers >=0.5.6.2 && <0.7
, unordered-containers >=0.2.20 && <0.3
, uuid-types >=1.0.6 && <1.1
, vector >=0.13.2.0 && <0.14
, old-time >=1.1.0.0 && <1.2
, scientific >=0.3.8.0 && <0.4
, strict >=0.5 && <0.6
, tagged >=0.8.8 && <0.9
, text >=1.2.4.1 && <1.3 || >=2.0 && <2.2
, text-short >=0.1.4 && <0.2
, these >=1.2.1 && <1.3
, time-compat >=1.9.4 && <1.10
, transformers >=0.5.6.2 && <0.7
, unordered-containers >=0.2.20 && <0.3
, uuid-types >=1.0.6 && <1.1
, vector >=0.13.2.0 && <0.14

if impl(ghc <9.4)
build-depends: data-array-byte >=0.1.0.1 && <0.2
Expand All @@ -124,7 +118,6 @@ test-suite self-test
, primitive
, QuickCheck
, quickcheck-instances
, tagged
, uuid-types

if impl(ghc >=8.0 && <9.4)
Expand Down
23 changes: 0 additions & 23 deletions src/Test/QuickCheck/Instances/Natural.hs
Original file line number Diff line number Diff line change
@@ -1,25 +1,2 @@
{-# OPTIONS_GHC -fno-warn-orphans #-}
module Test.QuickCheck.Instances.Natural () where

import Prelude ()

import Numeric.Natural (Natural)

import Test.QuickCheck
(Arbitrary (..), CoArbitrary (..), arbitrarySizedNatural,
coarbitraryIntegral, shrinkIntegral)
import Test.QuickCheck.Function (Function (..), functionIntegral)

-------------------------------------------------------------------------------
-- nats
-------------------------------------------------------------------------------

instance Arbitrary Natural where
arbitrary = arbitrarySizedNatural
shrink = shrinkIntegral

instance CoArbitrary Natural where
coarbitrary = coarbitraryIntegral

instance Function Natural where
function = functionIntegral
32 changes: 0 additions & 32 deletions src/Test/QuickCheck/Instances/Primitive.hs
Original file line number Diff line number Diff line change
@@ -1,34 +1,2 @@
{-# OPTIONS_GHC -fno-warn-orphans #-}
module Test.QuickCheck.Instances.Primitive () where

import Prelude ()
import Test.QuickCheck.Instances.CustomPrelude

import Data.Word (Word8)

import Test.QuickCheck

import qualified Data.Primitive as P

-------------------------------------------------------------------------------
-- ByteArray
-------------------------------------------------------------------------------

-- | @since 0.3.28
instance Arbitrary P.ByteArray where
arbitrary = byteArrayFromList <$> arbitrary
shrink ba = byteArrayFromList <$> shrink (byteArrayToList ba)

-- | @since 0.3.28
instance CoArbitrary P.ByteArray where
coarbitrary ba = coarbitrary (byteArrayToList ba)

-- | @since 0.3.28
instance Function P.ByteArray where
function = functionMap byteArrayToList byteArrayFromList

byteArrayFromList :: [Word8] -> P.ByteArray
byteArrayFromList = P.byteArrayFromList

byteArrayToList :: P.ByteArray -> [Word8]
byteArrayToList = P.foldrByteArray (:) []
Loading