packages feed

stock-quickcheck

Derive Arbitrary via the stock plugin

view on Hackage

The <https://hackage.haskell.org/package/stock stock> plugin provides a newtype __@<https://hackage-content.haskell.org/package/stock-0.1.0.0/docs/Stock.html#t:Stock Stock>@__ for deriving and synthesising instances at compile time. __stock-quickcheck__ extends it to support @<https://hackage-content.haskell.org/package/QuickCheck-2.18.0.0/docs/Test-QuickCheck.html#t:Arbitrary Arbitrary>@, @<https://hackage-content.haskell.org/package/QuickCheck-2.18.0.0/docs/Test-QuickCheck.html#t:CoArbitrary CoArbitrary>@, and their higher-kinded variants. > {-# options_ghc -fplugin Stock #-} > > {-# language DerivingVia #-} > {-# language DataKinds #-} > > import Stock > import Stock.QuickCheck > > import Test.QuickCheck > > data Person = P { name :: String, age :: Int } > deriving (Eq, Ord, Show, Read) via > Stock Person > deriving Arbitrary via > Overriding Person > [ name via ASCIIString, age via Positive ] __stock-quickcheck__ provides four instances, that signal to the plugin how to derive @<https://hackage-content.haskell.org/package/QuickCheck-2.18.0.0/docs/Test-QuickCheck.html#t:Arbitrary Arbitrary>@, @<https://hackage-content.haskell.org/package/QuickCheck-2.18.0.0/docs/Test-QuickCheck.html#t:Arbitrary1 Arbitrary1>@, @<https://hackage-content.haskell.org/package/QuickCheck-2.18.0.0/docs/Test-QuickCheck.html#t:Arbitrary2 Arbitrary2>@ and @<https://hackage-content.haskell.org/package/QuickCheck-2.18.0.0/docs/Test-QuickCheck.html#t:CoArbitrary CoArbitrary>@. @arbitrary@ is structural and size-aware, in the style of @<https://hackage-content.haskell.org/package/generic-arbitrary generic-arbitrary>@. It picks a constructor, preferring terminal constructors once the size runs out, so recursive types terminate, and fills each field with its own @arbitrary@, dividing the size among recursive fields. @shrink@ defaults. > instance DeriveStock Arbitrary .. > instance DeriveStock1 Arbitrary1 .. > instance DeriveStock2 Arbitrary2 .. > instance DeriveStock CoArbitrary .. <https://hackage.haskell.org/package/stock stock> companion packages include: * __@<https://hackage.haskell.org/package/stock-deepseq stock-deepseq>@__: @<https://hackage-content.haskell.org/package/deepseq-1.5.2.0/docs/Control-DeepSeq.html#t:NFData NFData>@, @<https://hackage-content.haskell.org/package/deepseq-1.5.2.0/docs/Control-DeepSeq.html#t:NFData1 NFData1>@, @<https://hackage-content.haskell.org/package/deepseq-1.5.2.0/docs/Control-DeepSeq.html#t:NFData2 NFData2>@ * __@<https://hackage.haskell.org/package/stock-hashable stock-hashable>@__: @<https://hackage-content.haskell.org/package/hashable-1.5.1.0/docs/Data-Hashable.html#t:Hashable Hashable>@, @<https://hackage-content.haskell.org/package/hashable-1.5.1.0/docs/Data-Hashable-Lifted.html#t:Hashable1 Hashable1>@, @<https://hackage-content.haskell.org/package/hashable-1.5.1.0/docs/Data-Hashable-Lifted.html#t:Hashable2 Hashable2>@ * __@<https://hackage.haskell.org/package/stock-aeson stock-aeson>@__: @<https://hackage-content.haskell.org/package/aeson-2.3.0.0/docs/Data-Aeson.html#t:ToJSON ToJSON>@, @<https://hackage-content.haskell.org/package/aeson-2.3.0.0/docs/Data-Aeson.html#t:ToJSON1 ToJSON1>@, @<https://hackage-content.haskell.org/package/aeson-2.3.0.0/docs/Data-Aeson.html#t:ToJSON2 ToJSON2>@; @<https://hackage-content.haskell.org/package/aeson-2.3.0.0/docs/Data-Aeson.html#t:FromJSON FromJSON>@, @<https://hackage-content.haskell.org/package/aeson-2.3.0.0/docs/Data-Aeson.html#t:FromJSON1 FromJSON1>@, @<https://hackage-content.haskell.org/package/aeson-2.3.0.0/docs/Data-Aeson.html#t:FromJSON2 FromJSON2>@ * __@stock-quickcheck@__: @<https://hackage-content.haskell.org/package/QuickCheck-2.18.0.0/docs/Test-QuickCheck.html#t:Arbitrary Arbitrary>@, @<https://hackage-content.haskell.org/package/QuickCheck-2.18.0.0/docs/Test-QuickCheck.html#t:Arbitrary1 Arbitrary1>@, @<https://hackage-content.haskell.org/package/QuickCheck-2.18.0.0/docs/Test-QuickCheck.html#t:Arbitrary2 Arbitrary2>@; @<https://hackage-content.haskell.org/package/QuickCheck-2.18.0.0/docs/Test-QuickCheck.html#t:CoArbitrary CoArbitrary>@ * __@<https://hackage.haskell.org/package/stock-profunctors stock-profunctors>@__: @<https://hackage-content.haskell.org/package/profunctors-5.6.3/docs/Data-Profunctor.html#t:Profunctor Profunctor>@
versionuploadeduploaderchanges
0.1.0.02026-06-23 15:43 UTCBaldurBlondal5 revisions+647/−0 lines, 4 filesdep +QuickCheckdep +basedep +ghc

Dependencies of stock-quickcheck-0.1.0.0

QuickCheck >=2.14 && <2.19 2.18.0.0 → 2.19.0.0 newer than bounds
2026-09-16 11:18 UTC2.19.0.0 newer than bounds+67/−41 lines, 10 filesdep +OneTuplePVP ok
2026-02-26 12:42 UTC2.18.0.0+826/−542 lines, 23 filesPVP ok
2025-10-13 12:40 UTC2.17.1.0+18/−8 lines, 4 filesdep ~randomPVP: major bump suggested
2025-10-07 12:26 UTC2.17.0.0+667/−129 lines, 14 filesdep +data-array-bytedep +hintdep +splitdep −ghc-primdep −old-localedep −old-timedep ~basedep ~randomdep ~template-haskellPVP ok
2025-06-17 07:53 UTC2.16.0.0+477/−86 lines, 15 filesdep ~basenew-uploaderPVP ok

showing 5 of 66 versions

base >=4.18 && <5 4.22.0.0 → 4.22.1.0
2026-12-01 12:38 UTC4.22.1.0+388/−6 lines, 9 filesdep ~ghc-internalPVP: major bump suggested
2025-12-19 11:52 UTC4.22.0.0+886/−215 lines, 28 filesdep ~ghc-internalPVP ok
2026-03-27 12:26 UTC4.21.2.0+10/−3 lines, 4 filesdep ~ghc-internalPVP ok
2025-12-27 10:31 UTC4.21.1.0+17/−5 lines, 4 filesdep ~ghc-internalPVP ok
2024-12-16 09:24 UTC4.21.0.0+1170/−396 lines, 39 filesdep ~ghc-internalPVP ok

showing 5 of 61 versions

ghc >=9.6 && <9.16 9.14.1 → 9.14.2
2026-12-01 12:38 UTC9.14.2+9989/−5774 lines, 231 filesdep ~ghc-bootdep ~ghc-boot-thdep ~ghc-boot-th-nextPVP: major bump suggested
2025-12-19 11:51 UTC9.14.1+94968/−73927 lines, 535 filesdep +ghc-internaldep ~basedep ~containersdep ~ghc-bootsetup-changedPVP ok
2026-03-27 12:26 UTC9.12.4+3128/−1766 lines, 79 filesdep +rtsdep ~ghc-bootdep ~ghc-boot-thdep ~ghc-boot-th-nextPVP: major bump suggested
2025-12-27 10:29 UTC9.12.3+6833/−5245 lines, 117 filesdep ~ghc-bootdep ~ghc-boot-thdep ~ghc-boot-th-nextPVP: major bump suggested
2025-06-16 15:02 UTC9.12.2+182/−697 lines, 17 filesdep ~ghc-bootdep ~ghc-boot-thdep ~ghc-boot-th-nextPVP: major bump suggested

showing 5 of 51 versions

stock >=0.1 && <0.2 0.1.0.1 → 0.1.0.2
2026-06-24 09:53 UTC0.1.0.2+305/−22 lines, 9 filesdep +processdep ~basePVP ok
2026-06-24 02:18 UTC0.1.0.1+150/−101 lines, 8 filesPVP: major bump suggested
2026-06-23 14:40 UTC0.1.0.0+8536/−0 lines, 33 filesdep +basedep +ghcdep +inspection-testing

Reverse dependencies

no known reverse dependencies