Skip to content

Commit beea48d

Browse files
authored
Merge pull request #105 from haskellari/strict-vector
Add instances for strict vectors (vector-0.13.2.0)
2 parents b853ddf + f3633de commit beea48d

File tree

5 files changed

+39
-22
lines changed

5 files changed

+39
-22
lines changed

.github/workflows/haskell-ci.yml

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,9 @@
88
#
99
# For more information, see https://github.com/haskell-CI/haskell-ci
1010
#
11-
# version: 0.19.20241223
11+
# version: 0.19.20250604
1212
#
13-
# REGENDATA ("0.19.20241223",["github","cabal.project"])
13+
# REGENDATA ("0.19.20250604",["github","cabal.project"])
1414
#
1515
name: Haskell-CI
1616
on:
@@ -23,7 +23,7 @@ on:
2323
jobs:
2424
linux:
2525
name: Haskell-CI - Linux - ${{ matrix.compiler }}
26-
runs-on: ubuntu-20.04
26+
runs-on: ubuntu-24.04
2727
timeout-minutes:
2828
60
2929
container:
@@ -32,24 +32,24 @@ jobs:
3232
strategy:
3333
matrix:
3434
include:
35-
- compiler: ghc-9.12.1
35+
- compiler: ghc-9.12.2
3636
compilerKind: ghc
37-
compilerVersion: 9.12.1
37+
compilerVersion: 9.12.2
3838
setup-method: ghcup
3939
allow-failure: false
40-
- compiler: ghc-9.10.1
40+
- compiler: ghc-9.10.2
4141
compilerKind: ghc
42-
compilerVersion: 9.10.1
42+
compilerVersion: 9.10.2
4343
setup-method: ghcup
4444
allow-failure: false
4545
- compiler: ghc-9.8.4
4646
compilerKind: ghc
4747
compilerVersion: 9.8.4
4848
setup-method: ghcup
4949
allow-failure: false
50-
- compiler: ghc-9.6.6
50+
- compiler: ghc-9.6.7
5151
compilerKind: ghc
52-
compilerVersion: 9.6.6
52+
compilerVersion: 9.6.7
5353
setup-method: ghcup
5454
allow-failure: false
5555
- compiler: ghc-9.4.8
@@ -91,12 +91,12 @@ jobs:
9191
- name: Install GHCup
9292
run: |
9393
mkdir -p "$HOME/.ghcup/bin"
94-
curl -sL https://downloads.haskell.org/ghcup/0.1.30.0/x86_64-linux-ghcup-0.1.30.0 > "$HOME/.ghcup/bin/ghcup"
94+
curl -sL https://downloads.haskell.org/ghcup/0.1.50.1/x86_64-linux-ghcup-0.1.50.1 > "$HOME/.ghcup/bin/ghcup"
9595
chmod a+x "$HOME/.ghcup/bin/ghcup"
9696
- name: Install cabal-install
9797
run: |
98-
"$HOME/.ghcup/bin/ghcup" install cabal 3.14.1.0 || (cat "$HOME"/.ghcup/logs/*.* && false)
99-
echo "CABAL=$HOME/.ghcup/bin/cabal-3.14.1.0 -vnormal+nowrap" >> "$GITHUB_ENV"
98+
"$HOME/.ghcup/bin/ghcup" install cabal 3.14.2.0 || (cat "$HOME"/.ghcup/logs/*.* && false)
99+
echo "CABAL=$HOME/.ghcup/bin/cabal-3.14.2.0 -vnormal+nowrap" >> "$GITHUB_ENV"
100100
- name: Install GHC (GHCup)
101101
if: matrix.setup-method == 'ghcup'
102102
run: |
@@ -257,10 +257,10 @@ jobs:
257257
if [ $((HCNUMVER < 90400)) -ne 0 ] ; then $CABAL v2-test $ARG_COMPILER --enable-tests --disable-benchmarks --constraint='text ^>=1.2.3.0' all ; fi
258258
- name: constraint set lower-bounds-8.6.5
259259
run: |
260-
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.1.0' all --dry-run ; fi
260+
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
261261
if [ $((HCNUMVER < 80800)) -ne 0 ] ; then cabal-plan topo | sort ; fi
262-
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.1.0' --dependencies-only -j2 all ; fi
263-
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.1.0' all ; fi
262+
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
263+
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
264264
- name: save cache
265265
if: always()
266266
uses: actions/cache/save@v4

CHANGES

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
0.3.33
2+
3+
* Add instances for strict vectors
4+
15
0.3.32
26

37
* Add instances for primitive vectors

cabal.haskell-ci

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ constraint-set lower-bounds-8.6.5
2222
transformers ==0.5.6.2,
2323
unordered-containers ==0.2.20,
2424
uuid-types ==1.0.6,
25-
vector ==0.13.1.0
25+
vector ==0.13.2.0
2626

2727
constraint-set text-1.2
2828
ghc: <9.3

quickcheck-instances.cabal

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
cabal-version: 2.2
22
name: quickcheck-instances
3-
version: 0.3.32
4-
x-revision: 1
3+
version: 0.3.33
54
synopsis: Common quickcheck instances
65
description:
76
QuickCheck instances.
@@ -34,10 +33,10 @@ tested-with:
3433
|| ==9.0.2
3534
|| ==9.2.8
3635
|| ==9.4.8
37-
|| ==9.6.6
36+
|| ==9.6.7
3837
|| ==9.8.4
39-
|| ==9.10.1
40-
|| ==9.12.1
38+
|| ==9.10.2
39+
|| ==9.12.2
4140

4241
source-repository head
4342
type: git
@@ -106,7 +105,7 @@ library
106105
, transformers >=0.5.6.2 && <0.7
107106
, unordered-containers >=0.2.20 && <0.3
108107
, uuid-types >=1.0.6 && <1.1
109-
, vector >=0.13.1.0 && <0.14
108+
, vector >=0.13.2.0 && <0.14
110109

111110
if impl(ghc <9.4)
112111
build-depends: data-array-byte >=0.1.0.1 && <0.2

src/Test/QuickCheck/Instances/Vector.hs

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ import qualified Data.Vector.Generic as GVector
1212
import qualified Data.Vector.Primitive as PVector
1313
import qualified Data.Vector.Storable as SVector
1414
import qualified Data.Vector.Unboxed as UVector
15+
import qualified Data.Vector.Strict as BVector
1516

1617
-------------------------------------------------------------------------------
1718
-- vector
@@ -65,6 +66,19 @@ instance (PVector.Prim a, CoArbitrary a) => CoArbitrary (PVector.Vector a) where
6566
instance (PVector.Prim a, Function a) => Function (PVector.Vector a) where
6667
function = functionVector
6768

69+
-- | @since 0.3.33
70+
instance (Arbitrary a) => Arbitrary (BVector.Vector a) where
71+
arbitrary = arbitraryVector
72+
shrink = shrinkVector
73+
74+
-- | @since 0.3.33
75+
instance (CoArbitrary a) => CoArbitrary (BVector.Vector a) where
76+
coarbitrary = coarbitraryVector
77+
78+
-- | @since 0.3.33
79+
instance (Function a) => Function (BVector.Vector a) where
80+
function = functionVector
81+
6882
arbitraryVector :: (GVector.Vector v a, Arbitrary a) => Gen (v a)
6983
arbitraryVector = GVector.fromList `fmap` arbitrary
7084

0 commit comments

Comments
 (0)