-
Notifications
You must be signed in to change notification settings - Fork 22
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #95 from haskellari/noble
Support GHC-8.6.5...9.10.1
- Loading branch information
Showing
28 changed files
with
113 additions
and
356 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1 @@ | ||
packages: . | ||
|
||
-- allow-newer: bytestring | ||
-- constraints: bytestring ^>=0.11 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
cabal-version: 2.2 | ||
name: quickcheck-instances | ||
version: 0.3.30 | ||
x-revision: 1 | ||
version: 0.3.31 | ||
synopsis: Common quickcheck instances | ||
description: | ||
QuickCheck instances. | ||
|
@@ -14,7 +14,7 @@ description: | |
impose these instances on down-stream consumers of | ||
your code. | ||
|
||
license: BSD3 | ||
license: BSD-3-Clause | ||
license-file: LICENSE | ||
author: | ||
Antoine Latter <[email protected]>, Oleg Grenrus <[email protected]> | ||
|
@@ -26,35 +26,29 @@ copyright: Copyright 2012-2016 Antoine Latter, 2017-2019 Oleg Grenrus | |
category: Testing | ||
build-type: Simple | ||
extra-source-files: CHANGES | ||
cabal-version: >=1.10 | ||
tested-with: | ||
GHC ==7.4.2 | ||
|| ==7.6.3 | ||
|| ==7.8.4 | ||
|| ==7.10.3 | ||
|| ==8.0.2 | ||
|| ==8.2.2 | ||
|| ==8.4.4 | ||
|| ==8.6.5 | ||
GHC ==8.6.5 | ||
|| ==8.8.4 | ||
|| ==8.10.7 | ||
|| ==9.0.2 | ||
|| ==9.2.8 | ||
|| ==9.4.7 | ||
|| ==9.6.3 | ||
|| ==9.8.1 | ||
|| ==9.4.8 | ||
|| ==9.6.5 | ||
|| ==9.8.2 | ||
|| ==9.10.1 | ||
|
||
source-repository head | ||
type: git | ||
location: https://github.com/haskellari/qc-instances.git | ||
|
||
flag bytestring-builder | ||
description: Use bytestring-builder (with old bytestring) | ||
default: False | ||
manual: False | ||
|
||
library | ||
default-language: Haskell2010 | ||
default-language: Haskell2010 | ||
default-extensions: | ||
BangPatterns | ||
FlexibleContexts | ||
FlexibleInstances | ||
TypeOperators | ||
|
||
exposed-modules: | ||
Test.QuickCheck.Instances | ||
Test.QuickCheck.Instances.Array | ||
|
@@ -73,6 +67,7 @@ library | |
Test.QuickCheck.Instances.Strict | ||
Test.QuickCheck.Instances.Tagged | ||
Test.QuickCheck.Instances.Text | ||
Test.QuickCheck.Instances.Text.Short | ||
Test.QuickCheck.Instances.These | ||
Test.QuickCheck.Instances.Time | ||
Test.QuickCheck.Instances.Transformer | ||
|
@@ -81,71 +76,48 @@ library | |
Test.QuickCheck.Instances.Vector | ||
Test.QuickCheck.Instances.Void | ||
|
||
other-modules: Test.QuickCheck.Instances.CustomPrelude | ||
hs-source-dirs: src | ||
other-modules: Test.QuickCheck.Instances.CustomPrelude | ||
hs-source-dirs: src | ||
build-depends: | ||
base >=4.5 && <4.20 | ||
, QuickCheck >=2.14.1 && <2.14.4 | ||
, splitmix >=0.0.2 && <0.2 | ||
, base >=4.12.0.0 && <4.21 | ||
, QuickCheck >=2.14.2 && <2.15.0 | ||
, splitmix >=0.1.0.5 && <0.2 | ||
|
||
build-depends: | ||
array >=0.4.0.0 && <0.6 | ||
, bytestring >=0.9.2.1 && <0.13 | ||
, case-insensitive >=1.2.0.4 && <1.3 | ||
, containers >=0.4.2.1 && <0.7 | ||
, 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.2.7.0 && <1.5 | ||
, integer-logarithms >=1.0.3 && <1.1 | ||
, hashable >=1.4.4.0 && <1.5 | ||
, integer-logarithms >=1.0.3.1 && <1.1 | ||
, old-time >=1.1.0.0 && <1.2 | ||
, OneTuple >=0.3 && <0.5 | ||
, primitive >=0.6.4.0 && <0.10 | ||
, scientific >=0.3.6.2 && <0.4 | ||
, strict >=0.4 && <0.6 | ||
, tagged >=0.8.6 && <0.9 | ||
, text >=1.2.3.0 && <1.3 || >=2.0 && <2.2 | ||
, these >=1.1.1.1 && <1.3 | ||
, 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.3.0.0 && <0.7 | ||
, transformers-compat >=0.6.5 && <0.8 | ||
, unordered-containers >=0.2.2.0 && <0.3 | ||
, uuid-types >=1.0.4 && <1.1 | ||
, vector >=0.12.3.1 && <0.14 | ||
, transformers >=0.5.6.2 && <0.7 | ||
, unordered-containers >=0.2.20 && <0.3 | ||
, uuid-types >=1.0.6 && <1.1 | ||
, vector >=0.13.1.0 && <0.14 | ||
|
||
-- version is irrelevant. | ||
build-depends: time | ||
|
||
if impl(ghc >=8.0 && <9.4) | ||
if impl(ghc <9.4) | ||
build-depends: data-array-byte >=0.1.0.1 && <0.2 | ||
|
||
if !impl(ghc >=8.0) | ||
build-depends: semigroups >=0.18.5 && <0.21 | ||
|
||
if !impl(ghc >=7.10) | ||
build-depends: | ||
nats >=1.1.2 && <1.2 | ||
, void >=0.7.2 && <0.8 | ||
|
||
if flag(bytestring-builder) | ||
build-depends: | ||
bytestring <0.10.4.0 | ||
, bytestring-builder >=0.10.4 && <0.11 | ||
|
||
else | ||
build-depends: bytestring >=0.10.4.0 | ||
|
||
if impl(ghc >=7.8) | ||
exposed-modules: Test.QuickCheck.Instances.Text.Short | ||
build-depends: text-short >=0.1.3 && <0.2 | ||
|
||
ghc-options: -Wall | ||
ghc-options: -Wall | ||
|
||
test-suite self-test | ||
default-language: Haskell2010 | ||
type: exitcode-stdio-1.0 | ||
main-is: Tests.hs | ||
hs-source-dirs: test | ||
build-depends: | ||
base | ||
, base | ||
, containers | ||
, primitive | ||
, QuickCheck | ||
|
@@ -162,7 +134,7 @@ benchmark bytestring-gen | |
main-is: ByteString.hs | ||
hs-source-dirs: bench | ||
build-depends: | ||
base | ||
, base | ||
, bytestring | ||
, QuickCheck | ||
, quickcheck-instances |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,36 +1,4 @@ | ||
{-# LANGUAGE CPP #-} | ||
{-# LANGUAGE FlexibleContexts #-} | ||
{-# OPTIONS_GHC -fno-warn-orphans #-} | ||
module Test.QuickCheck.Instances.Array.Byte () where | ||
|
||
#if !MIN_VERSION_primitive(0,8,0) && MIN_VERSION_base(4,9,0) | ||
|
||
import Prelude () | ||
import Test.QuickCheck.Instances.CustomPrelude | ||
import Test.QuickCheck.Instances.Primitive () | ||
|
||
import Test.QuickCheck | ||
|
||
import Data.Array.Byte (ByteArray (..)) | ||
import qualified Data.Primitive as P | ||
|
||
-- | @since 0.3.28 | ||
instance Arbitrary ByteArray where | ||
arbitrary = fromP <$> arbitrary | ||
shrink ba = fromP <$> shrink (toP ba) | ||
|
||
-- | @since 0.3.28 | ||
instance CoArbitrary ByteArray where | ||
coarbitrary ba = coarbitrary (toP ba) | ||
|
||
-- | @since 0.3.28 | ||
instance Function ByteArray where | ||
function = functionMap toP fromP | ||
|
||
toP :: ByteArray -> P.ByteArray | ||
toP (ByteArray ba) = P.ByteArray ba | ||
|
||
fromP :: P.ByteArray -> ByteArray | ||
fromP (P.ByteArray ba) = ByteArray ba | ||
|
||
#endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,58 +1 @@ | ||
{-# LANGUAGE CPP #-} | ||
{-# LANGUAGE FlexibleContexts #-} | ||
{-# OPTIONS_GHC -fno-warn-orphans #-} | ||
module Test.QuickCheck.Instances.Containers () where | ||
|
||
#if !MIN_VERSION_QuickCheck(2,14,2) | ||
import Prelude () | ||
import Test.QuickCheck.Instances.CustomPrelude | ||
|
||
import Test.QuickCheck | ||
(Arbitrary (..), Arbitrary1 (..), CoArbitrary (..), Function (..), Gen, | ||
arbitrary1, chooseInt, functionMap, liftShrink2, shrink1, shuffle, | ||
sized) | ||
|
||
import qualified Data.Tree as Tree | ||
|
||
------------------------------------------------------------------------------- | ||
-- containers | ||
------------------------------------------------------------------------------- | ||
|
||
instance Arbitrary1 Tree.Tree where | ||
liftArbitrary arb = sized $ \n -> do | ||
k <- chooseInt (0, n) | ||
go k | ||
where | ||
go n = do -- n is the size of the trees. | ||
value <- arb | ||
pars <- arbPartition (n - 1) -- can go negative! | ||
forest <- traverse go pars | ||
return $ Tree.Node value forest | ||
|
||
arbPartition :: Int -> Gen [Int] | ||
arbPartition k = case compare k 1 of | ||
LT -> pure [] | ||
EQ -> pure [1] | ||
GT -> do | ||
first <- chooseInt (1, k) | ||
rest <- arbPartition $ k - first | ||
shuffle (first : rest) | ||
|
||
liftShrink shr = go | ||
where | ||
go (Tree.Node val forest) = forest ++ | ||
[ Tree.Node e fs | ||
| (e, fs) <- liftShrink2 shr (liftShrink go) (val, forest) | ||
] | ||
|
||
instance Arbitrary a => Arbitrary (Tree.Tree a) where | ||
arbitrary = arbitrary1 | ||
shrink = shrink1 | ||
|
||
instance CoArbitrary a => CoArbitrary (Tree.Tree a) where | ||
coarbitrary (Tree.Node val forest) = | ||
coarbitrary val . coarbitrary forest | ||
|
||
instance Function a => Function (Tree.Tree a) where | ||
function = functionMap (\(Tree.Node x xs) -> (x,xs)) (uncurry Tree.Node) | ||
#endif |
Oops, something went wrong.