Cabal revisions of stock-0.1.0.0
Hackage metadata revisions edit the .cabal file after upload; each diff below is one revision.
revision 1
-cabal-version: 3.0-name: stock-version: 0.1.0.0-synopsis: Stock-style deriving via coercion, with no Generic-description:- A GHC type-checker plugin that derives class instances for @Stock T@- and higher-kinded variants at /compile time/, straight from the- structure of /T/ without a @Generic@ representation or runtime cost.- .- Supported classes:- .- * @Stock@: Eq, Ord, Show, Read, Semigroup, Monoid, Enum, Bounded, Ix, Generic- * @Stock1@: Functor, Foldable, Traversable, Contravariant, Applicative, Eq1, Ord1, Show1, Read1, Generic1, TestEquality, TestCoercion- * @Stock2@: Bifunctor, Bifoldable, Bitraversable, Eq2, Ord2, Show2, Read2, Category- .- Every claim below is machine-checked with @inspection-testing@ (it- compares optimised Core, not behaviour):- .- * For @Eq@, @Ord@, @Enum@, @Functor@, @Bounded@ and @Foldable@ the- emitted Core is /byte-identical/ to GHC's own stock deriving.- * @Traversable@ and @Bitraversable@ — which GHC cannot stock-derive- at all — produce a @traverse@\/@bitraverse@ /byte-identical/ to the- natural hand-written definition.- * Every remaining class is proven to erase the @Stock@ wrapper and- its coercions /completely/, so the instance is exactly as fast as a- hand-written one and behaves identically to stock deriving wherever- GHC has it.- .- In short: where GHC derives the class, the result is the same Core- GHC emits; where it does not, the result is the Core you would have- written by hand.- .- @Traversable@\/@Bitraversable@ are synthesised as genuine instances- but cannot be reached by a bare @deriving via@ (the coercion is- blocked by the abstract applicative's nominal role; see @"Stock"@).- .- Companion packages add more classes through @DeriveStock@ instances- (see @"Stock.Derive"@), discovered automatically without an extra- @-fplugin@ flag :- .- * @stock-deepseq@: NFData, NFData1, NFData2- * @stock-hashable@: Hashable, Hashable1, Hashable2- * @stock-aeson@: ToJSON, ToJSON1, ToJSON2; FromJSON, FromJSON1, FromJSON2- * @stock-quickcheck@: Arbitrary, Arbitrary1, Arbitrary2; CoArbitrary- * @stock-profunctors@: Profunctor- .- Ordinary @DerivingVia@ modifiers compose with @Stock@:- @Down (Stock T)@ reverses ordering, enumeration and bounds;- @Backwards (Stock1 F)@ reverses @Applicative@ effects; @Reverse- (Stock1 F)@ reverses @Foldable@\/@Traversable@.- .- > {-# options_ghc -fplugin Stock #-}- > {-# language DerivingVia #-}- > - > import Stock- > import Data.Ord (Down(..))- >- > -- >>> sort [Bronze, Silver, Gold]- > -- [Gold,Silver,Bronze]- > data Place = Bronze | Silver | Gold- > deriving (Eq, Show) via Stock Place- > deriving (Ord, Bounded, Enum) via Down (Stock Place)- .- Per-field modifiers (@Override@, @"Stock.Override"@, re-exported by- @"Stock"@) customise individual fields by name, type, or position; @_@- leaves a field unchanged. A modifier is any newtype with the relevant- instance.- . - Hit points and coins accumulate with addition, poisoning- contaminates by disjunction (or), @items@, and @weapons@ union with- addition to product a multiset.- .- > import Data.Map.Monoidal (MonoidalMap(..))- > ..- > type MultiSet key = MonoidalMap key (Sum Int)- > - > data Inventory = Inventory- > { hp :: Int- > , coins :: Int- > , poisoned :: Bool- > , items :: Map Item Int -- these unfortunately default- > , weapons :: Map Weapon Int -- to left-biased union- > }- > deriving (Eq, Ord, Show, Read) via- > Stock Inventory- > deriving (Semigroup, Monoid) via - > Overriding Inventory- > '[ hp via Sum - > , coins via Sum - > , poisoned via Any- > , items via MultiSet Item- > , weapons via MultiSet Weapon- > ]- .- Synthesis runs once per instance (not per use): @deriving Cls via Stock- T@ produces a single shared @instance Cls T@ that every call reuses.-license: BSD-3-Clause-license-file: LICENSE-author: Baldur Blöndal-maintainer: baldur.blondal@iohk.io-category: Type System-build-type: Simple-tested-with: GHC >= 9.6 && < 9.15- , GHC == 9.6.7- , GHC == 9.8.1, GHC == 9.8.2, GHC == 9.8.4- , GHC == 9.10.1, GHC == 9.10.2, GHC == 9.10.3- , GHC == 9.12.1, GHC == 9.12.2, GHC == 9.12.4- , GHC == 9.14.1-extra-doc-files: README.md- CHANGELOG.md-extra-source-files: LICENSE--common warnings- ghc-options: -Wall -Wcompat -Wincomplete-record-updates- -Wincomplete-uni-patterns -Wredundant-constraints- default-language: GHC2021--library- import: warnings- exposed-modules: Stock- Stock.Type- Stock.Derive- Stock.Override- Stock.Surface- Stock.Internal- Stock.Compat- Stock.Bounded- Stock.Eq- Stock.Ord- Stock.Semigroup- Stock.Show- Stock.Read- Stock.Enum- Stock.Functor- Stock.Applicative- Stock.Traversable- Stock.TestEquality- Stock.Bifunctor- Stock.Generic- Stock.Classes1- other-modules: Stock.Trans- build-depends: base >=4.18 && <5,- ghc >=9.6 && <9.16- hs-source-dirs: src plugin--test-suite examples- import: warnings- type: exitcode-stdio-1.0- main-is: Main.hs- other-modules: QualOverride- build-depends: base >=4.18 && <5,- transformers < 0.7,- stock- ghc-options: -fplugin=Stock- hs-source-dirs: examples--test-suite spec- import: warnings- type: exitcode-stdio-1.0- main-is: Spec.hs- other-modules: Twin- build-depends: base >=4.18 && <5,- stock- ghc-options: -fplugin=Stock- hs-source-dirs: test--benchmark bench- import: warnings- type: exitcode-stdio-1.0- main-is: Bench.hs- build-depends: base >=4.18 && <5,- stock- ghc-options: -O2 -rtsopts "-with-rtsopts=-K512m" -fplugin=Stock- hs-source-dirs: bench--benchmark configs- import: warnings- type: exitcode-stdio-1.0- main-is: Configs.hs- build-depends: base, stock- ghc-options: -O2 -fplugin=Stock- hs-source-dirs: bench--test-suite inspection- type: exitcode-stdio-1.0- main-is: Inspection.hs- build-depends: base, stock, inspection-testing- ghc-options: -fplugin=Stock- hs-source-dirs: inspection- default-language: GHC2021- if impl(ghc >= 9.14)- buildable: False--source-repository head- type: git- location: https://github.com/Icelandjack/stock.git+cabal-version: 3.0 +name: stock +version: 0.1.0.0 +synopsis: Stock-style deriving via coercion, with no Generic +x-revision: 1 +description: + A GHC type-checker plugin that derives class instances for @Stock T@ + and higher-kinded variants at /compile time/, straight from the + structure of /T/ without a @Generic@ representation or runtime cost. + + Supported classes: + + * @Stock@: @Eq@, @Ord@, @Show@, @Read@, @Semigroup@, @Monoid@, + @Enum@, @Bounded@, @Ix@, @Generic@ + * @Stock1@: @Functor@, @Foldable@, @Traversable@, @Contravariant@, + @Applicative@, @Eq1@, @Ord1@, @Show1@, @Read1@, @Generic1@, + @TestEquality@, @TestCoercion@ + * @Stock2@: @Bifunctor@, @Bifoldable@, @Bitraversable@, @Eq2@, + @Ord2@, @Show2@, @Read2@, @Category@ + + Every claim below is machine-checked with @inspection-testing@ (it + compares optimised Core, not behaviour): + + * For @Eq@, @Ord@, @Enum@, @Functor@, @Bounded@ and @Foldable@ the + emitted Core is /byte-identical/ to GHC's own stock deriving. + * @Traversable@ and @Bitraversable@ (which GHC cannot stock-derive + at all) produce a @traverse@/@bitraverse@ /byte-identical/ to the + natural hand-written definition. + * Every remaining class is proven to erase the @Stock@ wrapper and + its coercions /completely/, so the instance is exactly as fast as a + hand-written one and behaves identically to stock deriving wherever + GHC has it. + + In short: where GHC derives the class, the result is the same Core + GHC emits; where it does not, the result is the Core you would have + written by hand. + + @Traversable@/@Bitraversable@ are synthesised as genuine instances + but cannot be reached by a bare @deriving via@ (the coercion is + blocked by the abstract applicative's nominal role; see @Stock@). + + Companion packages add more classes through @DeriveStock@ instances + (see @Stock.Derive@), discovered automatically without an extra + @-fplugin@ flag: + + * @stock-deepseq@: @NFData@, @NFData1@, @NFData2@ + * @stock-hashable@: @Hashable@, @Hashable1@, @Hashable2@ + * @stock-aeson@: @ToJSON@, @ToJSON1@, @ToJSON2@; @FromJSON@, + @FromJSON1@, @FromJSON2@ + * @stock-quickcheck@: @Arbitrary@, @Arbitrary1@, @Arbitrary2@; + @CoArbitrary@ + * @stock-profunctors@: @Profunctor@ + + Ordinary @DerivingVia@ modifiers compose with @Stock@: + @Down (Stock T)@ reverses ordering, enumeration and bounds; + @Backwards (Stock1 F)@ reverses @Applicative@ effects; @Reverse + (Stock1 F)@ reverses @Foldable@/@Traversable@. + + > {-# options_ghc -fplugin Stock #-} + > {-# language DerivingVia #-} + > + > import Stock + > import Data.Ord (Down(..)) + > + > -- >>> sort [Bronze, Silver, Gold] + > -- [Gold,Silver,Bronze] + > data Place = Bronze | Silver | Gold + > deriving (Eq, Show) via Stock Place + > deriving (Ord, Bounded, Enum) via Down (Stock Place) + + Per-field modifiers (@Override@, @Stock.Override@, re-exported by + @Stock@) customise individual fields by name, type, or position; @_@ + leaves a field unchanged. A modifier is any newtype with the relevant + instance. + + Hit points and coins accumulate with addition, poisoning + contaminates by disjunction (or), @items@, and @weapons@ union with + addition to produce a multiset. + + > import Data.Map.Monoidal (MonoidalMap(..)) + > + > type MultiSet key = MonoidalMap key (Sum Int) + > + > data Inventory = Inventory + > { hp :: Int + > , coins :: Int + > , poisoned :: Bool + > , items :: Map Item Int + > , weapons :: Map Weapon Int + > } + > deriving (Eq, Ord, Show, Read) via Stock Inventory + > deriving (Semigroup, Monoid) via + > Overriding Inventory + > '[ hp via Sum + > , coins via Sum + > , poisoned via Any + > , items via MultiSet Item + > , weapons via MultiSet Weapon + > ] + + Synthesis runs once per instance (not per use): @deriving Cls via Stock + T@ produces a single shared @instance Cls T@ that every call reuses. +license: BSD-3-Clause +license-file: LICENSE +author: Baldur Blöndal +maintainer: baldur.blondal@iohk.io +category: Type System +build-type: Simple +tested-with: GHC >= 9.6 && < 9.15 + , GHC == 9.6.7 + , GHC == 9.8.1, GHC == 9.8.2, GHC == 9.8.4 + , GHC == 9.10.1, GHC == 9.10.2, GHC == 9.10.3 + , GHC == 9.12.1, GHC == 9.12.2, GHC == 9.12.4 + , GHC == 9.14.1 +extra-doc-files: README.md + CHANGELOG.md +extra-source-files: LICENSE + +common warnings + ghc-options: -Wall -Wcompat -Wincomplete-record-updates + -Wincomplete-uni-patterns -Wredundant-constraints + default-language: GHC2021 + +library + import: warnings + exposed-modules: Stock + Stock.Type + Stock.Derive + Stock.Override + Stock.Surface + Stock.Internal + Stock.Compat + Stock.Bounded + Stock.Eq + Stock.Ord + Stock.Semigroup + Stock.Show + Stock.Read + Stock.Enum + Stock.Functor + Stock.Applicative + Stock.Traversable + Stock.TestEquality + Stock.Bifunctor + Stock.Generic + Stock.Classes1 + other-modules: Stock.Trans + build-depends: base >=4.18 && <5, + ghc >=9.6 && <9.16 + hs-source-dirs: src plugin + +test-suite examples + import: warnings + type: exitcode-stdio-1.0 + main-is: Main.hs + other-modules: QualOverride + build-depends: base >=4.18 && <5, + transformers < 0.7, + stock + ghc-options: -fplugin=Stock + hs-source-dirs: examples + +test-suite spec + import: warnings + type: exitcode-stdio-1.0 + main-is: Spec.hs + other-modules: Twin + build-depends: base >=4.18 && <5, + stock + ghc-options: -fplugin=Stock + hs-source-dirs: test + +benchmark bench + import: warnings + type: exitcode-stdio-1.0 + main-is: Bench.hs + build-depends: base >=4.18 && <5, + stock + ghc-options: -O2 -rtsopts "-with-rtsopts=-K512m" -fplugin=Stock + hs-source-dirs: bench + +benchmark configs + import: warnings + type: exitcode-stdio-1.0 + main-is: Configs.hs + build-depends: base, stock + ghc-options: -O2 -fplugin=Stock + hs-source-dirs: bench + +test-suite inspection + type: exitcode-stdio-1.0 + main-is: Inspection.hs + build-depends: base, stock, inspection-testing + ghc-options: -fplugin=Stock + hs-source-dirs: inspection + default-language: GHC2021 + if impl(ghc >= 9.14) + buildable: False + +source-repository head + type: git + location: https://github.com/Icelandjack/stock.git
revision 2
name: stock version: 0.1.0.0 synopsis: Stock-style deriving via coercion, with no Generic -x-revision: 1 +x-revision: 2 description: - A GHC type-checker plugin that derives class instances for @Stock T@ + A GHC type-checker plugin that derives class instances for <https://hackage.haskell.org/package/stock/docs/Stock.html#t:Stock Stock> @T@ and higher-kinded variants at /compile time/, straight from the structure of /T/ without a @Generic@ representation or runtime cost. Supported classes: - * @Stock@: @Eq@, @Ord@, @Show@, @Read@, @Semigroup@, @Monoid@, + * <https://hackage.haskell.org/package/stock/docs/Stock.html#t:Stock Stock>: @Eq@, @Ord@, @Show@, @Read@, @Semigroup@, @Monoid@, @Enum@, @Bounded@, @Ix@, @Generic@ - * @Stock1@: @Functor@, @Foldable@, @Traversable@, @Contravariant@, + * <https://hackage.haskell.org/package/stock/docs/Stock.html#t:Stock1 Stock1>: @Functor@, @Foldable@, @Traversable@, @Contravariant@, @Applicative@, @Eq1@, @Ord1@, @Show1@, @Read1@, @Generic1@, @TestEquality@, @TestCoercion@ - * @Stock2@: @Bifunctor@, @Bifoldable@, @Bitraversable@, @Eq2@, + * <https://hackage.haskell.org/package/stock/docs/Stock.html#t:Stock2 Stock2>: @Bifunctor@, @Bifoldable@, @Bitraversable@, @Eq2@, @Ord2@, @Show2@, @Read2@, @Category@ Every claim below is machine-checked with @inspection-testing@ (it * @Traversable@ and @Bitraversable@ (which GHC cannot stock-derive at all) produce a @traverse@/@bitraverse@ /byte-identical/ to the natural hand-written definition. - * Every remaining class is proven to erase the @Stock@ wrapper and + * Every remaining class is proven to erase the <https://hackage.haskell.org/package/stock/docs/Stock.html#t:Stock Stock> wrapper and its coercions /completely/, so the instance is exactly as fast as a hand-written one and behaves identically to stock deriving wherever GHC has it. @Traversable@/@Bitraversable@ are synthesised as genuine instances but cannot be reached by a bare @deriving via@ (the coercion is - blocked by the abstract applicative's nominal role; see @Stock@). + blocked by the abstract applicative's nominal role; see "Stock"). Companion packages add more classes through @DeriveStock@ instances - (see @Stock.Derive@), discovered automatically without an extra + (see "Stock.Derive"), discovered automatically without an extra @-fplugin@ flag: - * @stock-deepseq@: @NFData@, @NFData1@, @NFData2@ - * @stock-hashable@: @Hashable@, @Hashable1@, @Hashable2@ - * @stock-aeson@: @ToJSON@, @ToJSON1@, @ToJSON2@; @FromJSON@, + * <https://hackage.haskell.org/package/stock-deepseq stock-deepseq>: @NFData@, @NFData1@, @NFData2@ + * <https://hackage.haskell.org/package/stock-hashable stock-hashable>: @Hashable@, @Hashable1@, @Hashable2@ + * <https://hackage.haskell.org/package/stock-aeson stock-aeson>: @ToJSON@, @ToJSON1@, @ToJSON2@; @FromJSON@, @FromJSON1@, @FromJSON2@ - * @stock-quickcheck@: @Arbitrary@, @Arbitrary1@, @Arbitrary2@; + * <https://hackage.haskell.org/package/stock-quickcheck stock-quickcheck>: @Arbitrary@, @Arbitrary1@, @Arbitrary2@; @CoArbitrary@ - * @stock-profunctors@: @Profunctor@ + * <https://hackage.haskell.org/package/stock-profunctors stock-profunctors>: @Profunctor@ - Ordinary @DerivingVia@ modifiers compose with @Stock@: + Ordinary @DerivingVia@ modifiers compose with <https://hackage.haskell.org/package/stock/docs/Stock.html#t:Stock Stock>: @Down (Stock T)@ reverses ordering, enumeration and bounds; @Backwards (Stock1 F)@ reverses @Applicative@ effects; @Reverse (Stock1 F)@ reverses @Foldable@/@Traversable@. > deriving (Eq, Show) via Stock Place > deriving (Ord, Bounded, Enum) via Down (Stock Place) - Per-field modifiers (@Override@, @Stock.Override@, re-exported by - @Stock@) customise individual fields by name, type, or position; @_@ + Per-field modifiers (@Override@, "Stock.Override", re-exported by + "Stock") customise individual fields by name, type, or position; @_@ leaves a field unchanged. A modifier is any newtype with the relevant instance. > deriving (Eq, Ord, Show, Read) via Stock Inventory > deriving (Semigroup, Monoid) via > Overriding Inventory - > '[ hp via Sum - > , coins via Sum + > '[ hp via Sum + > , coins via Sum > , poisoned via Any - > , items via MultiSet Item - > , weapons via MultiSet Weapon + > , items via MultiSet Item + > , weapons via MultiSet Weapon > ] Synthesis runs once per instance (not per use): @deriving Cls via Stock
revision 3
name: stock version: 0.1.0.0 synopsis: Stock-style deriving via coercion, with no Generic -x-revision: 2 +x-revision: 3 description: - A GHC type-checker plugin that derives class instances for <https://hackage.haskell.org/package/stock/docs/Stock.html#t:Stock Stock> @T@ - and higher-kinded variants at /compile time/, straight from the + A GHC type-checker plugin that derives class instances for + <https://hackage.haskell.org/package/stock/docs/Stock.html#t:Stock Stock> + @T@ and higher-kinded variants at /compile time/, straight from the structure of /T/ without a @Generic@ representation or runtime cost. Supported classes: - * <https://hackage.haskell.org/package/stock/docs/Stock.html#t:Stock Stock>: @Eq@, @Ord@, @Show@, @Read@, @Semigroup@, @Monoid@, - @Enum@, @Bounded@, @Ix@, @Generic@ - * <https://hackage.haskell.org/package/stock/docs/Stock.html#t:Stock1 Stock1>: @Functor@, @Foldable@, @Traversable@, @Contravariant@, - @Applicative@, @Eq1@, @Ord1@, @Show1@, @Read1@, @Generic1@, - @TestEquality@, @TestCoercion@ - * <https://hackage.haskell.org/package/stock/docs/Stock.html#t:Stock2 Stock2>: @Bifunctor@, @Bifoldable@, @Bitraversable@, @Eq2@, - @Ord2@, @Show2@, @Read2@, @Category@ + * @<https://hackage.haskell.org/package/stock/docs/Stock.html#t:Stock Stock>@: 'Eq', 'Ord', 'Show', 'Read', 'Semigroup', 'Monoid', + 'Enum', 'Bounded', 'Ix', 'Generic' + * @<https://hackage.haskell.org/package/stock/docs/Stock.html#t:Stock1 Stock1>@: 'Functor', 'Foldable', 'Traversable', 'Contravariant', + 'Applicative', 'Eq1', 'Ord1', 'Show1', 'Read1', 'Generic1', + 'TestEquality', 'TestCoercion' + * @<https://hackage.haskell.org/package/stock/docs/Stock.html#t:Stock2 Stock2>@: 'Bifunctor', 'Bifoldable', 'Bitraversable', 'Eq2', + 'Ord2', 'Show2', 'Read2', 'Category' Every claim below is machine-checked with @inspection-testing@ (it compares optimised Core, not behaviour): - * For @Eq@, @Ord@, @Enum@, @Functor@, @Bounded@ and @Foldable@ the + * For 'Eq', 'Ord', 'Enum', 'Functor', 'Bounded' and 'Foldable' the emitted Core is /byte-identical/ to GHC's own stock deriving. - * @Traversable@ and @Bitraversable@ (which GHC cannot stock-derive - at all) produce a @traverse@/@bitraverse@ /byte-identical/ to the + * 'Traversable' and 'Bitraversable' (which GHC cannot stock-derive + at all) produce a 'traverse'/'bitraverse' /byte-identical/ to the natural hand-written definition. - * Every remaining class is proven to erase the <https://hackage.haskell.org/package/stock/docs/Stock.html#t:Stock Stock> wrapper and - its coercions /completely/, so the instance is exactly as fast as a - hand-written one and behaves identically to stock deriving wherever - GHC has it. + * Every remaining class is proven to erase the + @<https://hackage.haskell.org/package/stock/docs/Stock.html#t:Stock Stock>@ + wrapper and its coercions /completely/, so the instance is exactly + as fast as a hand-written one and behaves identically to stock + deriving wherever GHC has it. In short: where GHC derives the class, the result is the same Core GHC emits; where it does not, the result is the Core you would have written by hand. - @Traversable@/@Bitraversable@ are synthesised as genuine instances + 'Traversable'/'Bitraversable' are synthesised as genuine instances but cannot be reached by a bare @deriving via@ (the coercion is blocked by the abstract applicative's nominal role; see "Stock"). (see "Stock.Derive"), discovered automatically without an extra @-fplugin@ flag: - * <https://hackage.haskell.org/package/stock-deepseq stock-deepseq>: @NFData@, @NFData1@, @NFData2@ - * <https://hackage.haskell.org/package/stock-hashable stock-hashable>: @Hashable@, @Hashable1@, @Hashable2@ - * <https://hackage.haskell.org/package/stock-aeson stock-aeson>: @ToJSON@, @ToJSON1@, @ToJSON2@; @FromJSON@, - @FromJSON1@, @FromJSON2@ - * <https://hackage.haskell.org/package/stock-quickcheck stock-quickcheck>: @Arbitrary@, @Arbitrary1@, @Arbitrary2@; - @CoArbitrary@ - * <https://hackage.haskell.org/package/stock-profunctors stock-profunctors>: @Profunctor@ + * @<https://hackage.haskell.org/package/stock-deepseq stock-deepseq>@: @<https://hackage.haskell.org/package/deepseq/docs/Control-DeepSeq.html#t:NFData NFData>@, @<https://hackage.haskell.org/package/deepseq/docs/Control-DeepSeq.html#t:NFData1 NFData1>@, @<https://hackage.haskell.org/package/deepseq/docs/Control-DeepSeq.html#t:NFData2 NFData2>@ + * @<https://hackage.haskell.org/package/stock-hashable stock-hashable>@: @<https://hackage.haskell.org/package/hashable/docs/Data-Hashable.html#t:Hashable Hashable>@, @<https://hackage.haskell.org/package/hashable/docs/Data-Hashable-Lifted.html#t:Hashable1 Hashable1>@, @<https://hackage.haskell.org/package/hashable/docs/Data-Hashable-Lifted.html#t:Hashable2 Hashable2>@ + * @<https://hackage.haskell.org/package/stock-aeson stock-aeson>@: @<https://hackage.haskell.org/package/aeson/docs/Data-Aeson.html#t:ToJSON ToJSON>@, @<https://hackage.haskell.org/package/aeson/docs/Data-Aeson.html#t:ToJSON1 ToJSON1>@, @<https://hackage.haskell.org/package/aeson/docs/Data-Aeson.html#t:ToJSON2 ToJSON2>@; @<https://hackage.haskell.org/package/aeson/docs/Data-Aeson.html#t:FromJSON FromJSON>@, @<https://hackage.haskell.org/package/aeson/docs/Data-Aeson.html#t:FromJSON1 FromJSON1>@, @<https://hackage.haskell.org/package/aeson/docs/Data-Aeson.html#t:FromJSON2 FromJSON2>@ + * @<https://hackage.haskell.org/package/stock-quickcheck stock-quickcheck>@: @<https://hackage.haskell.org/package/QuickCheck/docs/Test-QuickCheck.html#t:Arbitrary Arbitrary>@, @<https://hackage.haskell.org/package/QuickCheck/docs/Test-QuickCheck.html#t:Arbitrary1 Arbitrary1>@, @<https://hackage.haskell.org/package/QuickCheck/docs/Test-QuickCheck.html#t:Arbitrary2 Arbitrary2>@; @<https://hackage.haskell.org/package/QuickCheck/docs/Test-QuickCheck.html#t:CoArbitrary CoArbitrary>@ + * @<https://hackage.haskell.org/package/stock-profunctors stock-profunctors>@: @<https://hackage.haskell.org/package/profunctors/docs/Data-Profunctor.html#t:Profunctor Profunctor>@ - Ordinary @DerivingVia@ modifiers compose with <https://hackage.haskell.org/package/stock/docs/Stock.html#t:Stock Stock>: - @Down (Stock T)@ reverses ordering, enumeration and bounds; - @Backwards (Stock1 F)@ reverses @Applicative@ effects; @Reverse - (Stock1 F)@ reverses @Foldable@/@Traversable@. + Ordinary @DerivingVia@ modifiers compose with + <https://hackage.haskell.org/package/stock/docs/Stock.html#t:Stock Stock>: + @<https://hackage-content.haskell.org/package/base-4.22.0.0/docs/Data-Ord.html#t:Down Down (Stock T)>@ + reverses ordering, enumeration and bounds; + @<https://hackage-content.haskell.org/package/transformers-0.6.3.0/docs/Control-Applicative-Backwards.html#t:Backwards Backwards (Stock1 F)>@ + reverses 'Applicative' effects; + @<https://hackage-content.haskell.org/package/transformers-0.6.3.0/docs/Data-Functor-Reverse.html#t:Reverse Reverse (Stock1 F)>@ + reverses 'Foldable'/'Traversable'. > {-# options_ghc -fplugin Stock #-} > {-# language DerivingVia #-} leaves a field unchanged. A modifier is any newtype with the relevant instance. - Hit points and coins accumulate with addition, poisoning - contaminates by disjunction (or), @items@, and @weapons@ union with - addition to produce a multiset. + This game example shows hit points and coins accumulate with + addition, poisoning contaminates by disjunction (or), @items@, and + @weapons@ union with addition to produce a multiset. > import Data.Map.Monoidal (MonoidalMap(..)) > > , items :: Map Item Int > , weapons :: Map Weapon Int > } - > deriving (Eq, Ord, Show, Read) via Stock Inventory + > deriving (Eq, Ord, Show, Read) via + > Stock Inventory > deriving (Semigroup, Monoid) via > Overriding Inventory > '[ hp via Sum
revision 4
name: stock version: 0.1.0.0 synopsis: Stock-style deriving via coercion, with no Generic -x-revision: 3 +x-revision: 4 description: A GHC type-checker plugin that derives class instances for <https://hackage.haskell.org/package/stock/docs/Stock.html#t:Stock Stock> Supported classes: - * @<https://hackage.haskell.org/package/stock/docs/Stock.html#t:Stock Stock>@: 'Eq', 'Ord', 'Show', 'Read', 'Semigroup', 'Monoid', - 'Enum', 'Bounded', 'Ix', 'Generic' - * @<https://hackage.haskell.org/package/stock/docs/Stock.html#t:Stock1 Stock1>@: 'Functor', 'Foldable', 'Traversable', 'Contravariant', - 'Applicative', 'Eq1', 'Ord1', 'Show1', 'Read1', 'Generic1', - 'TestEquality', 'TestCoercion' - * @<https://hackage.haskell.org/package/stock/docs/Stock.html#t:Stock2 Stock2>@: 'Bifunctor', 'Bifoldable', 'Bitraversable', 'Eq2', - 'Ord2', 'Show2', 'Read2', 'Category' + * __@<https://hackage.haskell.org/package/stock/docs/Stock.html#t:Stock Stock>@__: @<https://hackage.haskell.org/package/base/docs/Data-Eq.html#t:Eq Eq>@, @<https://hackage.haskell.org/package/base/docs/Data-Ord.html#t:Ord Ord>@, @<https://hackage.haskell.org/package/base/docs/Text-Show.html#t:Show Show>@, @<https://hackage.haskell.org/package/base/docs/Text-Read.html#t:Read Read>@, @<https://hackage.haskell.org/package/base/docs/Data-Semigroup.html#t:Semigroup Semigroup>@, @<https://hackage.haskell.org/package/base/docs/Data-Monoid.html#t:Monoid Monoid>@, + @<https://hackage.haskell.org/package/base/docs/Prelude.html#t:Enum Enum>@, @<https://hackage.haskell.org/package/base/docs/Prelude.html#t:Bounded Bounded>@, @<https://hackage.haskell.org/package/base/docs/Data-Ix.html#t:Ix Ix>@, @<https://hackage.haskell.org/package/base/docs/GHC-Generics.html#t:Generic Generic>@ + * __@<https://hackage.haskell.org/package/stock/docs/Stock.html#t:Stock1 Stock1>@__: @<https://hackage.haskell.org/package/base/docs/Data-Functor.html#t:Functor Functor>@, @<https://hackage.haskell.org/package/base/docs/Data-Foldable.html#t:Foldable Foldable>@, @<https://hackage.haskell.org/package/base/docs/Data-Traversable.html#t:Traversable Traversable>@, @<https://hackage.haskell.org/package/base/docs/Data-Functor-Contravariant.html#t:Contravariant Contravariant>@, + @<https://hackage.haskell.org/package/base/docs/Control-Applicative.html#t:Applicative Applicative>@, @<https://hackage.haskell.org/package/base/docs/Data-Functor-Classes.html#t:Eq1 Eq1>@, @<https://hackage.haskell.org/package/base/docs/Data-Functor-Classes.html#t:Ord1 Ord1>@, @<https://hackage.haskell.org/package/base/docs/Data-Functor-Classes.html#t:Show1 Show1>@, @<https://hackage.haskell.org/package/base/docs/Data-Functor-Classes.html#t:Read1 Read1>@, @<https://hackage.haskell.org/package/base/docs/GHC-Generics.html#t:Generic1 Generic1>@, + @<https://hackage.haskell.org/package/base/docs/Data-Type-Equality.html#t:TestEquality TestEquality>@, @<https://hackage.haskell.org/package/base/docs/Data-Type-Coercion.html#t:TestCoercion TestCoercion>@ + * __@<https://hackage.haskell.org/package/stock/docs/Stock.html#t:Stock2 Stock2>@__: @<https://hackage.haskell.org/package/base/docs/Data-Bifunctor.html#t:Bifunctor Bifunctor>@, @<https://hackage.haskell.org/package/base/docs/Data-Bifoldable.html#t:Bifoldable Bifoldable>@, @<https://hackage.haskell.org/package/base/docs/Data-Bitraversable.html#t:Bitraversable Bitraversable>@, @<https://hackage.haskell.org/package/base/docs/Data-Functor-Classes.html#t:Eq2 Eq2>@, + @<https://hackage.haskell.org/package/base/docs/Data-Functor-Classes.html#t:Ord2 Ord2>@, @<https://hackage.haskell.org/package/base/docs/Data-Functor-Classes.html#t:Show2 Show2>@, @<https://hackage.haskell.org/package/base/docs/Data-Functor-Classes.html#t:Read2 Read2>@, @<https://hackage.haskell.org/package/base/docs/Control-Category.html#t:Category Category>@ Every claim below is machine-checked with @inspection-testing@ (it compares optimised Core, not behaviour): - * For 'Eq', 'Ord', 'Enum', 'Functor', 'Bounded' and 'Foldable' the + * For @<https://hackage.haskell.org/package/base/docs/Data-Eq.html#t:Eq Eq>@, @<https://hackage.haskell.org/package/base/docs/Data-Ord.html#t:Ord Ord>@, @<https://hackage.haskell.org/package/base/docs/Prelude.html#t:Enum Enum>@, @<https://hackage.haskell.org/package/base/docs/Data-Functor.html#t:Functor Functor>@, @<https://hackage.haskell.org/package/base/docs/Prelude.html#t:Bounded Bounded>@ and @<https://hackage.haskell.org/package/base/docs/Data-Foldable.html#t:Foldable Foldable>@ the emitted Core is /byte-identical/ to GHC's own stock deriving. - * 'Traversable' and 'Bitraversable' (which GHC cannot stock-derive - at all) produce a 'traverse'/'bitraverse' /byte-identical/ to the + * @<https://hackage.haskell.org/package/base/docs/Data-Traversable.html#t:Traversable Traversable>@ and @<https://hackage.haskell.org/package/base/docs/Data-Bitraversable.html#t:Bitraversable Bitraversable>@ (which GHC cannot stock-derive + at all) produce a @<https://hackage.haskell.org/package/base/docs/Data-Traversable.html#v:traverse traverse>@/@<https://hackage.haskell.org/package/base/docs/Data-Bitraversable.html#v:bitraverse bitraverse>@ /byte-identical/ to the natural hand-written definition. * Every remaining class is proven to erase the @<https://hackage.haskell.org/package/stock/docs/Stock.html#t:Stock Stock>@ GHC emits; where it does not, the result is the Core you would have written by hand. - 'Traversable'/'Bitraversable' are synthesised as genuine instances + @<https://hackage.haskell.org/package/base/docs/Data-Traversable.html#t:Traversable Traversable>@/@<https://hackage.haskell.org/package/base/docs/Data-Bitraversable.html#t:Bitraversable Bitraversable>@ are synthesised as genuine instances but cannot be reached by a bare @deriving via@ (the coercion is blocked by the abstract applicative's nominal role; see "Stock"). (see "Stock.Derive"), discovered automatically without an extra @-fplugin@ flag: - * @<https://hackage.haskell.org/package/stock-deepseq stock-deepseq>@: @<https://hackage.haskell.org/package/deepseq/docs/Control-DeepSeq.html#t:NFData NFData>@, @<https://hackage.haskell.org/package/deepseq/docs/Control-DeepSeq.html#t:NFData1 NFData1>@, @<https://hackage.haskell.org/package/deepseq/docs/Control-DeepSeq.html#t:NFData2 NFData2>@ - * @<https://hackage.haskell.org/package/stock-hashable stock-hashable>@: @<https://hackage.haskell.org/package/hashable/docs/Data-Hashable.html#t:Hashable Hashable>@, @<https://hackage.haskell.org/package/hashable/docs/Data-Hashable-Lifted.html#t:Hashable1 Hashable1>@, @<https://hackage.haskell.org/package/hashable/docs/Data-Hashable-Lifted.html#t:Hashable2 Hashable2>@ - * @<https://hackage.haskell.org/package/stock-aeson stock-aeson>@: @<https://hackage.haskell.org/package/aeson/docs/Data-Aeson.html#t:ToJSON ToJSON>@, @<https://hackage.haskell.org/package/aeson/docs/Data-Aeson.html#t:ToJSON1 ToJSON1>@, @<https://hackage.haskell.org/package/aeson/docs/Data-Aeson.html#t:ToJSON2 ToJSON2>@; @<https://hackage.haskell.org/package/aeson/docs/Data-Aeson.html#t:FromJSON FromJSON>@, @<https://hackage.haskell.org/package/aeson/docs/Data-Aeson.html#t:FromJSON1 FromJSON1>@, @<https://hackage.haskell.org/package/aeson/docs/Data-Aeson.html#t:FromJSON2 FromJSON2>@ - * @<https://hackage.haskell.org/package/stock-quickcheck stock-quickcheck>@: @<https://hackage.haskell.org/package/QuickCheck/docs/Test-QuickCheck.html#t:Arbitrary Arbitrary>@, @<https://hackage.haskell.org/package/QuickCheck/docs/Test-QuickCheck.html#t:Arbitrary1 Arbitrary1>@, @<https://hackage.haskell.org/package/QuickCheck/docs/Test-QuickCheck.html#t:Arbitrary2 Arbitrary2>@; @<https://hackage.haskell.org/package/QuickCheck/docs/Test-QuickCheck.html#t:CoArbitrary CoArbitrary>@ - * @<https://hackage.haskell.org/package/stock-profunctors stock-profunctors>@: @<https://hackage.haskell.org/package/profunctors/docs/Data-Profunctor.html#t:Profunctor Profunctor>@ + * __@<https://hackage.haskell.org/package/stock-deepseq stock-deepseq>@__: @<https://hackage.haskell.org/package/deepseq/docs/Control-DeepSeq.html#t:NFData NFData>@, @<https://hackage.haskell.org/package/deepseq/docs/Control-DeepSeq.html#t:NFData1 NFData1>@, @<https://hackage.haskell.org/package/deepseq/docs/Control-DeepSeq.html#t:NFData2 NFData2>@ + * __@<https://hackage.haskell.org/package/stock-hashable stock-hashable>@__: @<https://hackage.haskell.org/package/hashable/docs/Data-Hashable.html#t:Hashable Hashable>@, @<https://hackage.haskell.org/package/hashable/docs/Data-Hashable-Lifted.html#t:Hashable1 Hashable1>@, @<https://hackage.haskell.org/package/hashable/docs/Data-Hashable-Lifted.html#t:Hashable2 Hashable2>@ + * __@<https://hackage.haskell.org/package/stock-aeson stock-aeson>@__: @<https://hackage.haskell.org/package/aeson/docs/Data-Aeson.html#t:ToJSON ToJSON>@, @<https://hackage.haskell.org/package/aeson/docs/Data-Aeson.html#t:ToJSON1 ToJSON1>@, @<https://hackage.haskell.org/package/aeson/docs/Data-Aeson.html#t:ToJSON2 ToJSON2>@; @<https://hackage.haskell.org/package/aeson/docs/Data-Aeson.html#t:FromJSON FromJSON>@, @<https://hackage.haskell.org/package/aeson/docs/Data-Aeson.html#t:FromJSON1 FromJSON1>@, @<https://hackage.haskell.org/package/aeson/docs/Data-Aeson.html#t:FromJSON2 FromJSON2>@ + * __@<https://hackage.haskell.org/package/stock-quickcheck stock-quickcheck>@__: @<https://hackage.haskell.org/package/QuickCheck/docs/Test-QuickCheck.html#t:Arbitrary Arbitrary>@, @<https://hackage.haskell.org/package/QuickCheck/docs/Test-QuickCheck.html#t:Arbitrary1 Arbitrary1>@, @<https://hackage.haskell.org/package/QuickCheck/docs/Test-QuickCheck.html#t:Arbitrary2 Arbitrary2>@; @<https://hackage.haskell.org/package/QuickCheck/docs/Test-QuickCheck.html#t:CoArbitrary CoArbitrary>@ + * __@<https://hackage.haskell.org/package/stock-profunctors stock-profunctors>@__: @<https://hackage.haskell.org/package/profunctors/docs/Data-Profunctor.html#t:Profunctor Profunctor>@ Ordinary @DerivingVia@ modifiers compose with <https://hackage.haskell.org/package/stock/docs/Stock.html#t:Stock Stock>: @<https://hackage-content.haskell.org/package/base-4.22.0.0/docs/Data-Ord.html#t:Down Down (Stock T)>@ reverses ordering, enumeration and bounds; @<https://hackage-content.haskell.org/package/transformers-0.6.3.0/docs/Control-Applicative-Backwards.html#t:Backwards Backwards (Stock1 F)>@ - reverses 'Applicative' effects; + reverses @<https://hackage.haskell.org/package/base/docs/Control-Applicative.html#t:Applicative Applicative>@ effects; @<https://hackage-content.haskell.org/package/transformers-0.6.3.0/docs/Data-Functor-Reverse.html#t:Reverse Reverse (Stock1 F)>@ - reverses 'Foldable'/'Traversable'. + reverses @<https://hackage.haskell.org/package/base/docs/Data-Foldable.html#t:Foldable Foldable>@/@<https://hackage.haskell.org/package/base/docs/Data-Traversable.html#t:Traversable Traversable>@. > {-# options_ghc -fplugin Stock #-} > {-# language DerivingVia #-}
revision 5
name: stock version: 0.1.0.0 synopsis: Stock-style deriving via coercion, with no Generic -x-revision: 4 +x-revision: 5 description: A GHC type-checker plugin that derives class instances for <https://hackage.haskell.org/package/stock/docs/Stock.html#t:Stock Stock> * For @<https://hackage.haskell.org/package/base/docs/Data-Eq.html#t:Eq Eq>@, @<https://hackage.haskell.org/package/base/docs/Data-Ord.html#t:Ord Ord>@, @<https://hackage.haskell.org/package/base/docs/Prelude.html#t:Enum Enum>@, @<https://hackage.haskell.org/package/base/docs/Data-Functor.html#t:Functor Functor>@, @<https://hackage.haskell.org/package/base/docs/Prelude.html#t:Bounded Bounded>@ and @<https://hackage.haskell.org/package/base/docs/Data-Foldable.html#t:Foldable Foldable>@ the emitted Core is /byte-identical/ to GHC's own stock deriving. - * @<https://hackage.haskell.org/package/base/docs/Data-Traversable.html#t:Traversable Traversable>@ and @<https://hackage.haskell.org/package/base/docs/Data-Bitraversable.html#t:Bitraversable Bitraversable>@ (which GHC cannot stock-derive - at all) produce a @<https://hackage.haskell.org/package/base/docs/Data-Traversable.html#v:traverse traverse>@/@<https://hackage.haskell.org/package/base/docs/Data-Bitraversable.html#v:bitraverse bitraverse>@ /byte-identical/ to the - natural hand-written definition. + * @<https://hackage.haskell.org/package/base/docs/Data-Traversable.html#t:Traversable Traversable>@ and @<https://hackage.haskell.org/package/base/docs/Data-Bitraversable.html#t:Bitraversable Bitraversable>@ (which GHC cannot stock-derive at all) produce a @<https://hackage.haskell.org/package/base/docs/Data-Traversable.html#v:traverse traverse>@ / @<https://hackage.haskell.org/package/base/docs/Data-Bitraversable.html#v:bitraverse bitraverse>@ /byte-identical/ to the natural hand-written definition. * Every remaining class is proven to erase the @<https://hackage.haskell.org/package/stock/docs/Stock.html#t:Stock Stock>@ wrapper and its coercions /completely/, so the instance is exactly Ordinary @DerivingVia@ modifiers compose with <https://hackage.haskell.org/package/stock/docs/Stock.html#t:Stock Stock>: - @<https://hackage-content.haskell.org/package/base-4.22.0.0/docs/Data-Ord.html#t:Down Down (Stock T)>@ - reverses ordering, enumeration and bounds; - @<https://hackage-content.haskell.org/package/transformers-0.6.3.0/docs/Control-Applicative-Backwards.html#t:Backwards Backwards (Stock1 F)>@ - reverses @<https://hackage.haskell.org/package/base/docs/Control-Applicative.html#t:Applicative Applicative>@ effects; - @<https://hackage-content.haskell.org/package/transformers-0.6.3.0/docs/Data-Functor-Reverse.html#t:Reverse Reverse (Stock1 F)>@ - reverses @<https://hackage.haskell.org/package/base/docs/Data-Foldable.html#t:Foldable Foldable>@/@<https://hackage.haskell.org/package/base/docs/Data-Traversable.html#t:Traversable Traversable>@. + + * @<https://hackage-content.haskell.org/package/base-4.22.0.0/docs/Data-Ord.html#t:Down Down (Stock T)>@ reverses ordering, enumeration and bounds + * @<https://hackage-content.haskell.org/package/transformers-0.6.3.0/docs/Control-Applicative-Backwards.html#t:Backwards Backwards (Stock1 F)>@ reverses @<https://hackage.haskell.org/package/base/docs/Control-Applicative.html#t:Applicative Applicative>@ effects + * @<https://hackage-content.haskell.org/package/transformers-0.6.3.0/docs/Data-Functor-Reverse.html#t:Reverse Reverse (Stock1 F)>@ + reverses @<https://hackage.haskell.org/package/base/docs/Data-Foldable.html#t:Foldable Foldable>@ / @<https://hackage.haskell.org/package/base/docs/Data-Traversable.html#t:Traversable Traversable>@ > {-# options_ghc -fplugin Stock #-} > {-# language DerivingVia #-}
revision 6
name: stock version: 0.1.0.0 synopsis: Stock-style deriving via coercion, with no Generic -x-revision: 5 +x-revision: 6 description: A GHC type-checker plugin that derives class instances for <https://hackage.haskell.org/package/stock/docs/Stock.html#t:Stock Stock> * For @<https://hackage.haskell.org/package/base/docs/Data-Eq.html#t:Eq Eq>@, @<https://hackage.haskell.org/package/base/docs/Data-Ord.html#t:Ord Ord>@, @<https://hackage.haskell.org/package/base/docs/Prelude.html#t:Enum Enum>@, @<https://hackage.haskell.org/package/base/docs/Data-Functor.html#t:Functor Functor>@, @<https://hackage.haskell.org/package/base/docs/Prelude.html#t:Bounded Bounded>@ and @<https://hackage.haskell.org/package/base/docs/Data-Foldable.html#t:Foldable Foldable>@ the emitted Core is /byte-identical/ to GHC's own stock deriving. - * @<https://hackage.haskell.org/package/base/docs/Data-Traversable.html#t:Traversable Traversable>@ and @<https://hackage.haskell.org/package/base/docs/Data-Bitraversable.html#t:Bitraversable Bitraversable>@ (which GHC cannot stock-derive at all) produce a @<https://hackage.haskell.org/package/base/docs/Data-Traversable.html#v:traverse traverse>@ / @<https://hackage.haskell.org/package/base/docs/Data-Bitraversable.html#v:bitraverse bitraverse>@ /byte-identical/ to the natural hand-written definition. + * @<https://hackage.haskell.org/package/base/docs/Data-Traversable.html#t:Traversable Traversable>@ and @<https://hackage.haskell.org/package/base/docs/Data-Bitraversable.html#t:Bitraversable Bitraversable>@ (which GHC cannot stock-derive at all) produce a @<https://hackage.haskell.org/package/base/docs/Data-Traversable.html#v:traverse traverse>@, @<https://hackage.haskell.org/package/base/docs/Data-Bitraversable.html#v:bitraverse bitraverse>@ /byte-identical/ to the natural hand-written definition. * Every remaining class is proven to erase the @<https://hackage.haskell.org/package/stock/docs/Stock.html#t:Stock Stock>@ wrapper and its coercions /completely/, so the instance is exactly GHC emits; where it does not, the result is the Core you would have written by hand. - @<https://hackage.haskell.org/package/base/docs/Data-Traversable.html#t:Traversable Traversable>@/@<https://hackage.haskell.org/package/base/docs/Data-Bitraversable.html#t:Bitraversable Bitraversable>@ are synthesised as genuine instances + @<https://hackage.haskell.org/package/base/docs/Data-Traversable.html#t:Traversable Traversable>@, @<https://hackage.haskell.org/package/base/docs/Data-Bitraversable.html#t:Bitraversable Bitraversable>@ are synthesised as genuine instances but cannot be reached by a bare @deriving via@ (the coercion is blocked by the abstract applicative's nominal role; see "Stock").
revision 7
name: stock version: 0.1.0.0 synopsis: Stock-style deriving via coercion, with no Generic -x-revision: 6 +x-revision: 7 description: A GHC type-checker plugin that derives class instances for - <https://hackage.haskell.org/package/stock/docs/Stock.html#t:Stock Stock> + <https://hackage-content.haskell.org/package/stock-0.1.0.0/docs/Stock.html#t:Stock Stock> @T@ and higher-kinded variants at /compile time/, straight from the structure of /T/ without a @Generic@ representation or runtime cost. Supported classes: - * __@<https://hackage.haskell.org/package/stock/docs/Stock.html#t:Stock Stock>@__: @<https://hackage.haskell.org/package/base/docs/Data-Eq.html#t:Eq Eq>@, @<https://hackage.haskell.org/package/base/docs/Data-Ord.html#t:Ord Ord>@, @<https://hackage.haskell.org/package/base/docs/Text-Show.html#t:Show Show>@, @<https://hackage.haskell.org/package/base/docs/Text-Read.html#t:Read Read>@, @<https://hackage.haskell.org/package/base/docs/Data-Semigroup.html#t:Semigroup Semigroup>@, @<https://hackage.haskell.org/package/base/docs/Data-Monoid.html#t:Monoid Monoid>@, - @<https://hackage.haskell.org/package/base/docs/Prelude.html#t:Enum Enum>@, @<https://hackage.haskell.org/package/base/docs/Prelude.html#t:Bounded Bounded>@, @<https://hackage.haskell.org/package/base/docs/Data-Ix.html#t:Ix Ix>@, @<https://hackage.haskell.org/package/base/docs/GHC-Generics.html#t:Generic Generic>@ - * __@<https://hackage.haskell.org/package/stock/docs/Stock.html#t:Stock1 Stock1>@__: @<https://hackage.haskell.org/package/base/docs/Data-Functor.html#t:Functor Functor>@, @<https://hackage.haskell.org/package/base/docs/Data-Foldable.html#t:Foldable Foldable>@, @<https://hackage.haskell.org/package/base/docs/Data-Traversable.html#t:Traversable Traversable>@, @<https://hackage.haskell.org/package/base/docs/Data-Functor-Contravariant.html#t:Contravariant Contravariant>@, - @<https://hackage.haskell.org/package/base/docs/Control-Applicative.html#t:Applicative Applicative>@, @<https://hackage.haskell.org/package/base/docs/Data-Functor-Classes.html#t:Eq1 Eq1>@, @<https://hackage.haskell.org/package/base/docs/Data-Functor-Classes.html#t:Ord1 Ord1>@, @<https://hackage.haskell.org/package/base/docs/Data-Functor-Classes.html#t:Show1 Show1>@, @<https://hackage.haskell.org/package/base/docs/Data-Functor-Classes.html#t:Read1 Read1>@, @<https://hackage.haskell.org/package/base/docs/GHC-Generics.html#t:Generic1 Generic1>@, - @<https://hackage.haskell.org/package/base/docs/Data-Type-Equality.html#t:TestEquality TestEquality>@, @<https://hackage.haskell.org/package/base/docs/Data-Type-Coercion.html#t:TestCoercion TestCoercion>@ - * __@<https://hackage.haskell.org/package/stock/docs/Stock.html#t:Stock2 Stock2>@__: @<https://hackage.haskell.org/package/base/docs/Data-Bifunctor.html#t:Bifunctor Bifunctor>@, @<https://hackage.haskell.org/package/base/docs/Data-Bifoldable.html#t:Bifoldable Bifoldable>@, @<https://hackage.haskell.org/package/base/docs/Data-Bitraversable.html#t:Bitraversable Bitraversable>@, @<https://hackage.haskell.org/package/base/docs/Data-Functor-Classes.html#t:Eq2 Eq2>@, - @<https://hackage.haskell.org/package/base/docs/Data-Functor-Classes.html#t:Ord2 Ord2>@, @<https://hackage.haskell.org/package/base/docs/Data-Functor-Classes.html#t:Show2 Show2>@, @<https://hackage.haskell.org/package/base/docs/Data-Functor-Classes.html#t:Read2 Read2>@, @<https://hackage.haskell.org/package/base/docs/Control-Category.html#t:Category Category>@ + * __@<https://hackage-content.haskell.org/package/stock-0.1.0.0/docs/Stock.html#t:Stock Stock>@__: @<https://hackage-content.haskell.org/package/base-4.22.0.0/docs/Data-Eq.html#t:Eq Eq>@, @<https://hackage-content.haskell.org/package/base-4.22.0.0/docs/Data-Ord.html#t:Ord Ord>@, @<https://hackage-content.haskell.org/package/base-4.22.0.0/docs/Text-Show.html#t:Show Show>@, @<https://hackage-content.haskell.org/package/base-4.22.0.0/docs/Text-Read.html#t:Read Read>@, @<https://hackage-content.haskell.org/package/base-4.22.0.0/docs/Data-Semigroup.html#t:Semigroup Semigroup>@, @<https://hackage-content.haskell.org/package/base-4.22.0.0/docs/Data-Monoid.html#t:Monoid Monoid>@, + @<https://hackage-content.haskell.org/package/base-4.22.0.0/docs/Prelude.html#t:Enum Enum>@, @<https://hackage-content.haskell.org/package/base-4.22.0.0/docs/Prelude.html#t:Bounded Bounded>@, @<https://hackage-content.haskell.org/package/base-4.22.0.0/docs/Data-Ix.html#t:Ix Ix>@, @<https://hackage-content.haskell.org/package/base-4.22.0.0/docs/GHC-Generics.html#t:Generic Generic>@ + * __@<https://hackage-content.haskell.org/package/stock-0.1.0.0/docs/Stock.html#t:Stock1 Stock1>@__: @<https://hackage-content.haskell.org/package/base-4.22.0.0/docs/Data-Functor.html#t:Functor Functor>@, @<https://hackage-content.haskell.org/package/base-4.22.0.0/docs/Data-Foldable.html#t:Foldable Foldable>@, @<https://hackage-content.haskell.org/package/base-4.22.0.0/docs/Data-Traversable.html#t:Traversable Traversable>@, @<https://hackage-content.haskell.org/package/base-4.22.0.0/docs/Data-Functor-Contravariant.html#t:Contravariant Contravariant>@, + @<https://hackage-content.haskell.org/package/base-4.22.0.0/docs/Control-Applicative.html#t:Applicative Applicative>@, @<https://hackage-content.haskell.org/package/base-4.22.0.0/docs/Data-Functor-Classes.html#t:Eq1 Eq1>@, @<https://hackage-content.haskell.org/package/base-4.22.0.0/docs/Data-Functor-Classes.html#t:Ord1 Ord1>@, @<https://hackage-content.haskell.org/package/base-4.22.0.0/docs/Data-Functor-Classes.html#t:Show1 Show1>@, @<https://hackage-content.haskell.org/package/base-4.22.0.0/docs/Data-Functor-Classes.html#t:Read1 Read1>@, @<https://hackage-content.haskell.org/package/base-4.22.0.0/docs/GHC-Generics.html#t:Generic1 Generic1>@, + @<https://hackage-content.haskell.org/package/base-4.22.0.0/docs/Data-Type-Equality.html#t:TestEquality TestEquality>@, @<https://hackage-content.haskell.org/package/base-4.22.0.0/docs/Data-Type-Coercion.html#t:TestCoercion TestCoercion>@ + * __@<https://hackage-content.haskell.org/package/stock-0.1.0.0/docs/Stock.html#t:Stock2 Stock2>@__: @<https://hackage-content.haskell.org/package/base-4.22.0.0/docs/Data-Bifunctor.html#t:Bifunctor Bifunctor>@, @<https://hackage-content.haskell.org/package/base-4.22.0.0/docs/Data-Bifoldable.html#t:Bifoldable Bifoldable>@, @<https://hackage-content.haskell.org/package/base-4.22.0.0/docs/Data-Bitraversable.html#t:Bitraversable Bitraversable>@, @<https://hackage-content.haskell.org/package/base-4.22.0.0/docs/Data-Functor-Classes.html#t:Eq2 Eq2>@, + @<https://hackage-content.haskell.org/package/base-4.22.0.0/docs/Data-Functor-Classes.html#t:Ord2 Ord2>@, @<https://hackage-content.haskell.org/package/base-4.22.0.0/docs/Data-Functor-Classes.html#t:Show2 Show2>@, @<https://hackage-content.haskell.org/package/base-4.22.0.0/docs/Data-Functor-Classes.html#t:Read2 Read2>@, @<https://hackage-content.haskell.org/package/base-4.22.0.0/docs/Control-Category.html#t:Category Category>@ Every claim below is machine-checked with @inspection-testing@ (it compares optimised Core, not behaviour): - * For @<https://hackage.haskell.org/package/base/docs/Data-Eq.html#t:Eq Eq>@, @<https://hackage.haskell.org/package/base/docs/Data-Ord.html#t:Ord Ord>@, @<https://hackage.haskell.org/package/base/docs/Prelude.html#t:Enum Enum>@, @<https://hackage.haskell.org/package/base/docs/Data-Functor.html#t:Functor Functor>@, @<https://hackage.haskell.org/package/base/docs/Prelude.html#t:Bounded Bounded>@ and @<https://hackage.haskell.org/package/base/docs/Data-Foldable.html#t:Foldable Foldable>@ the + * For @<https://hackage-content.haskell.org/package/base-4.22.0.0/docs/Data-Eq.html#t:Eq Eq>@, @<https://hackage-content.haskell.org/package/base-4.22.0.0/docs/Data-Ord.html#t:Ord Ord>@, @<https://hackage-content.haskell.org/package/base-4.22.0.0/docs/Prelude.html#t:Enum Enum>@, @<https://hackage-content.haskell.org/package/base-4.22.0.0/docs/Data-Functor.html#t:Functor Functor>@, @<https://hackage-content.haskell.org/package/base-4.22.0.0/docs/Prelude.html#t:Bounded Bounded>@ and @<https://hackage-content.haskell.org/package/base-4.22.0.0/docs/Data-Foldable.html#t:Foldable Foldable>@ the emitted Core is /byte-identical/ to GHC's own stock deriving. - * @<https://hackage.haskell.org/package/base/docs/Data-Traversable.html#t:Traversable Traversable>@ and @<https://hackage.haskell.org/package/base/docs/Data-Bitraversable.html#t:Bitraversable Bitraversable>@ (which GHC cannot stock-derive at all) produce a @<https://hackage.haskell.org/package/base/docs/Data-Traversable.html#v:traverse traverse>@, @<https://hackage.haskell.org/package/base/docs/Data-Bitraversable.html#v:bitraverse bitraverse>@ /byte-identical/ to the natural hand-written definition. + * @<https://hackage-content.haskell.org/package/base-4.22.0.0/docs/Data-Traversable.html#t:Traversable Traversable>@ and @<https://hackage-content.haskell.org/package/base-4.22.0.0/docs/Data-Bitraversable.html#t:Bitraversable Bitraversable>@ (which GHC cannot stock-derive at all) produce a @<https://hackage-content.haskell.org/package/base-4.22.0.0/docs/Data-Traversable.html#v:traverse traverse>@, @<https://hackage-content.haskell.org/package/base-4.22.0.0/docs/Data-Bitraversable.html#v:bitraverse bitraverse>@ /byte-identical/ to the natural hand-written definition. * Every remaining class is proven to erase the - @<https://hackage.haskell.org/package/stock/docs/Stock.html#t:Stock Stock>@ + @<https://hackage-content.haskell.org/package/stock-0.1.0.0/docs/Stock.html#t:Stock Stock>@ wrapper and its coercions /completely/, so the instance is exactly as fast as a hand-written one and behaves identically to stock deriving wherever GHC has it. GHC emits; where it does not, the result is the Core you would have written by hand. - @<https://hackage.haskell.org/package/base/docs/Data-Traversable.html#t:Traversable Traversable>@, @<https://hackage.haskell.org/package/base/docs/Data-Bitraversable.html#t:Bitraversable Bitraversable>@ are synthesised as genuine instances + @<https://hackage-content.haskell.org/package/base-4.22.0.0/docs/Data-Traversable.html#t:Traversable Traversable>@, @<https://hackage-content.haskell.org/package/base-4.22.0.0/docs/Data-Bitraversable.html#t:Bitraversable Bitraversable>@ are synthesised as genuine instances but cannot be reached by a bare @deriving via@ (the coercion is blocked by the abstract applicative's nominal role; see "Stock"). (see "Stock.Derive"), discovered automatically without an extra @-fplugin@ flag: - * __@<https://hackage.haskell.org/package/stock-deepseq stock-deepseq>@__: @<https://hackage.haskell.org/package/deepseq/docs/Control-DeepSeq.html#t:NFData NFData>@, @<https://hackage.haskell.org/package/deepseq/docs/Control-DeepSeq.html#t:NFData1 NFData1>@, @<https://hackage.haskell.org/package/deepseq/docs/Control-DeepSeq.html#t:NFData2 NFData2>@ - * __@<https://hackage.haskell.org/package/stock-hashable stock-hashable>@__: @<https://hackage.haskell.org/package/hashable/docs/Data-Hashable.html#t:Hashable Hashable>@, @<https://hackage.haskell.org/package/hashable/docs/Data-Hashable-Lifted.html#t:Hashable1 Hashable1>@, @<https://hackage.haskell.org/package/hashable/docs/Data-Hashable-Lifted.html#t:Hashable2 Hashable2>@ - * __@<https://hackage.haskell.org/package/stock-aeson stock-aeson>@__: @<https://hackage.haskell.org/package/aeson/docs/Data-Aeson.html#t:ToJSON ToJSON>@, @<https://hackage.haskell.org/package/aeson/docs/Data-Aeson.html#t:ToJSON1 ToJSON1>@, @<https://hackage.haskell.org/package/aeson/docs/Data-Aeson.html#t:ToJSON2 ToJSON2>@; @<https://hackage.haskell.org/package/aeson/docs/Data-Aeson.html#t:FromJSON FromJSON>@, @<https://hackage.haskell.org/package/aeson/docs/Data-Aeson.html#t:FromJSON1 FromJSON1>@, @<https://hackage.haskell.org/package/aeson/docs/Data-Aeson.html#t:FromJSON2 FromJSON2>@ - * __@<https://hackage.haskell.org/package/stock-quickcheck stock-quickcheck>@__: @<https://hackage.haskell.org/package/QuickCheck/docs/Test-QuickCheck.html#t:Arbitrary Arbitrary>@, @<https://hackage.haskell.org/package/QuickCheck/docs/Test-QuickCheck.html#t:Arbitrary1 Arbitrary1>@, @<https://hackage.haskell.org/package/QuickCheck/docs/Test-QuickCheck.html#t:Arbitrary2 Arbitrary2>@; @<https://hackage.haskell.org/package/QuickCheck/docs/Test-QuickCheck.html#t:CoArbitrary CoArbitrary>@ - * __@<https://hackage.haskell.org/package/stock-profunctors stock-profunctors>@__: @<https://hackage.haskell.org/package/profunctors/docs/Data-Profunctor.html#t:Profunctor Profunctor>@ + * __@<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>@ + * __@<https://hackage.haskell.org/package/stock-quickcheck 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>@ Ordinary @DerivingVia@ modifiers compose with - <https://hackage.haskell.org/package/stock/docs/Stock.html#t:Stock Stock>: + <https://hackage-content.haskell.org/package/stock-0.1.0.0/docs/Stock.html#t:Stock Stock>: * @<https://hackage-content.haskell.org/package/base-4.22.0.0/docs/Data-Ord.html#t:Down Down (Stock T)>@ reverses ordering, enumeration and bounds - * @<https://hackage-content.haskell.org/package/transformers-0.6.3.0/docs/Control-Applicative-Backwards.html#t:Backwards Backwards (Stock1 F)>@ reverses @<https://hackage.haskell.org/package/base/docs/Control-Applicative.html#t:Applicative Applicative>@ effects + * @<https://hackage-content.haskell.org/package/transformers-0.6.3.0/docs/Control-Applicative-Backwards.html#t:Backwards Backwards (Stock1 F)>@ reverses @<https://hackage-content.haskell.org/package/base-4.22.0.0/docs/Control-Applicative.html#t:Applicative Applicative>@ effects * @<https://hackage-content.haskell.org/package/transformers-0.6.3.0/docs/Data-Functor-Reverse.html#t:Reverse Reverse (Stock1 F)>@ - reverses @<https://hackage.haskell.org/package/base/docs/Data-Foldable.html#t:Foldable Foldable>@ / @<https://hackage.haskell.org/package/base/docs/Data-Traversable.html#t:Traversable Traversable>@ + reverses @<https://hackage-content.haskell.org/package/base-4.22.0.0/docs/Data-Foldable.html#t:Foldable Foldable>@ / @<https://hackage-content.haskell.org/package/base-4.22.0.0/docs/Data-Traversable.html#t:Traversable Traversable>@ > {-# options_ghc -fplugin Stock #-} > {-# language DerivingVia #-}
revision 8
name: stock version: 0.1.0.0 synopsis: Stock-style deriving via coercion, with no Generic -x-revision: 7 +x-revision: 8 description: A GHC type-checker plugin that derives class instances for <https://hackage-content.haskell.org/package/stock-0.1.0.0/docs/Stock.html#t:Stock Stock> * __@<https://hackage-content.haskell.org/package/stock-0.1.0.0/docs/Stock.html#t:Stock2 Stock2>@__: @<https://hackage-content.haskell.org/package/base-4.22.0.0/docs/Data-Bifunctor.html#t:Bifunctor Bifunctor>@, @<https://hackage-content.haskell.org/package/base-4.22.0.0/docs/Data-Bifoldable.html#t:Bifoldable Bifoldable>@, @<https://hackage-content.haskell.org/package/base-4.22.0.0/docs/Data-Bitraversable.html#t:Bitraversable Bitraversable>@, @<https://hackage-content.haskell.org/package/base-4.22.0.0/docs/Data-Functor-Classes.html#t:Eq2 Eq2>@, @<https://hackage-content.haskell.org/package/base-4.22.0.0/docs/Data-Functor-Classes.html#t:Ord2 Ord2>@, @<https://hackage-content.haskell.org/package/base-4.22.0.0/docs/Data-Functor-Classes.html#t:Show2 Show2>@, @<https://hackage-content.haskell.org/package/base-4.22.0.0/docs/Data-Functor-Classes.html#t:Read2 Read2>@, @<https://hackage-content.haskell.org/package/base-4.22.0.0/docs/Control-Category.html#t:Category Category>@ - Every claim below is machine-checked with @inspection-testing@ (it - compares optimised Core, not behaviour): - - * For @<https://hackage-content.haskell.org/package/base-4.22.0.0/docs/Data-Eq.html#t:Eq Eq>@, @<https://hackage-content.haskell.org/package/base-4.22.0.0/docs/Data-Ord.html#t:Ord Ord>@, @<https://hackage-content.haskell.org/package/base-4.22.0.0/docs/Prelude.html#t:Enum Enum>@, @<https://hackage-content.haskell.org/package/base-4.22.0.0/docs/Data-Functor.html#t:Functor Functor>@, @<https://hackage-content.haskell.org/package/base-4.22.0.0/docs/Prelude.html#t:Bounded Bounded>@ and @<https://hackage-content.haskell.org/package/base-4.22.0.0/docs/Data-Foldable.html#t:Foldable Foldable>@ the - emitted Core is /byte-identical/ to GHC's own stock deriving. - * @<https://hackage-content.haskell.org/package/base-4.22.0.0/docs/Data-Traversable.html#t:Traversable Traversable>@ and @<https://hackage-content.haskell.org/package/base-4.22.0.0/docs/Data-Bitraversable.html#t:Bitraversable Bitraversable>@ (which GHC cannot stock-derive at all) produce a @<https://hackage-content.haskell.org/package/base-4.22.0.0/docs/Data-Traversable.html#v:traverse traverse>@, @<https://hackage-content.haskell.org/package/base-4.22.0.0/docs/Data-Bitraversable.html#v:bitraverse bitraverse>@ /byte-identical/ to the natural hand-written definition. - * Every remaining class is proven to erase the - @<https://hackage-content.haskell.org/package/stock-0.1.0.0/docs/Stock.html#t:Stock Stock>@ - wrapper and its coercions /completely/, so the instance is exactly - as fast as a hand-written one and behaves identically to stock - deriving wherever GHC has it. - - In short: where GHC derives the class, the result is the same Core - GHC emits; where it does not, the result is the Core you would have - written by hand. + Synthesized instances emulate GHC's stock @deriving@: often + /byte-identical/ optimised Core, and the @Stock@ wrapper always + erases at compile time (machine-checked with @inspection-testing@). @<https://hackage-content.haskell.org/package/base-4.22.0.0/docs/Data-Traversable.html#t:Traversable Traversable>@, @<https://hackage-content.haskell.org/package/base-4.22.0.0/docs/Data-Bitraversable.html#t:Bitraversable Bitraversable>@ are synthesised as genuine instances but cannot be reached by a bare @deriving via@ (the coercion is * @<https://hackage-content.haskell.org/package/base-4.22.0.0/docs/Data-Ord.html#t:Down Down (Stock T)>@ reverses ordering, enumeration and bounds * @<https://hackage-content.haskell.org/package/transformers-0.6.3.0/docs/Control-Applicative-Backwards.html#t:Backwards Backwards (Stock1 F)>@ reverses @<https://hackage-content.haskell.org/package/base-4.22.0.0/docs/Control-Applicative.html#t:Applicative Applicative>@ effects - * @<https://hackage-content.haskell.org/package/transformers-0.6.3.0/docs/Data-Functor-Reverse.html#t:Reverse Reverse (Stock1 F)>@ - reverses @<https://hackage-content.haskell.org/package/base-4.22.0.0/docs/Data-Foldable.html#t:Foldable Foldable>@ / @<https://hackage-content.haskell.org/package/base-4.22.0.0/docs/Data-Traversable.html#t:Traversable Traversable>@ + * @<https://hackage-content.haskell.org/package/transformers-0.6.3.0/docs/Data-Functor-Reverse.html#t:Reverse Reverse (Stock1 F)>@ reverses @<https://hackage-content.haskell.org/package/base-4.22.0.0/docs/Data-Foldable.html#t:Foldable Foldable>@ \/ @<https://hackage-content.haskell.org/package/base-4.22.0.0/docs/Data-Traversable.html#t:Traversable Traversable>@ > {-# options_ghc -fplugin Stock #-} > {-# language DerivingVia #-}
revision 9
name: stock version: 0.1.0.0 synopsis: Stock-style deriving via coercion, with no Generic -x-revision: 8 +x-revision: 9 description: A GHC type-checker plugin that derives class instances for - <https://hackage-content.haskell.org/package/stock-0.1.0.0/docs/Stock.html#t:Stock Stock> - @T@ and higher-kinded variants at /compile time/, straight from the - structure of /T/ without a @Generic@ representation or runtime cost. + <https://hackage-content.haskell.org/package/stock-0.1.0.0/docs/Stock.html#t:Stock + Stock> @T@ and higher-kinded variants at /compile time/, straight + from the structure of /T/ without a @Generic@ representation or + runtime cost. Synthesized instances emulate GHC's stock @deriving@. Supported classes: * __@<https://hackage-content.haskell.org/package/stock-0.1.0.0/docs/Stock.html#t:Stock2 Stock2>@__: @<https://hackage-content.haskell.org/package/base-4.22.0.0/docs/Data-Bifunctor.html#t:Bifunctor Bifunctor>@, @<https://hackage-content.haskell.org/package/base-4.22.0.0/docs/Data-Bifoldable.html#t:Bifoldable Bifoldable>@, @<https://hackage-content.haskell.org/package/base-4.22.0.0/docs/Data-Bitraversable.html#t:Bitraversable Bitraversable>@, @<https://hackage-content.haskell.org/package/base-4.22.0.0/docs/Data-Functor-Classes.html#t:Eq2 Eq2>@, @<https://hackage-content.haskell.org/package/base-4.22.0.0/docs/Data-Functor-Classes.html#t:Ord2 Ord2>@, @<https://hackage-content.haskell.org/package/base-4.22.0.0/docs/Data-Functor-Classes.html#t:Show2 Show2>@, @<https://hackage-content.haskell.org/package/base-4.22.0.0/docs/Data-Functor-Classes.html#t:Read2 Read2>@, @<https://hackage-content.haskell.org/package/base-4.22.0.0/docs/Control-Category.html#t:Category Category>@ - Synthesized instances emulate GHC's stock @deriving@: often - /byte-identical/ optimised Core, and the @Stock@ wrapper always - erases at compile time (machine-checked with @inspection-testing@). - - @<https://hackage-content.haskell.org/package/base-4.22.0.0/docs/Data-Traversable.html#t:Traversable Traversable>@, @<https://hackage-content.haskell.org/package/base-4.22.0.0/docs/Data-Bitraversable.html#t:Bitraversable Bitraversable>@ are synthesised as genuine instances - but cannot be reached by a bare @deriving via@ (the coercion is - blocked by the abstract applicative's nominal role; see "Stock"). + @<https://hackage-content.haskell.org/package/base-4.22.0.0/docs/Data-Traversable.html#t:Traversable Traversable>@, + @<https://hackage-content.haskell.org/package/base-4.22.0.0/docs/Data-Bitraversable.html#t:Bitraversable Bitraversable>@ + are supported by but cannot be derived via. Companion packages add more classes through @DeriveStock@ instances (see "Stock.Derive"), discovered automatically without an extra
revision 10
name: stock version: 0.1.0.0 synopsis: Stock-style deriving via coercion, with no Generic -x-revision: 9 +x-revision: 10 description: A GHC type-checker plugin that derives class instances for - <https://hackage-content.haskell.org/package/stock-0.1.0.0/docs/Stock.html#t:Stock - Stock> @T@ and higher-kinded variants at /compile time/, straight + __@<https://hackage-content.haskell.org/package/stock-0.1.0.0/docs/Stock.html#t:Stock Stock T>@__ and higher-kinded variants at /compile time/, straight from the structure of /T/ without a @Generic@ representation or runtime cost. Synthesized instances emulate GHC's stock @deriving@. > type MultiSet key = MonoidalMap key (Sum Int) > > data Inventory = Inventory - > { hp :: Int - > , coins :: Int - > , poisoned :: Bool - > , items :: Map Item Int - > , weapons :: Map Weapon Int + > { hp :: Int -- (+) + > , coins :: Int -- (+) + > , poisoned :: Bool -- (||) + > , items :: Map Item Int -- unionWith (+) + > , weapons :: Map Weapon Int -- unionWith (+) > } > deriving (Eq, Ord, Show, Read) via > Stock Inventory > deriving (Semigroup, Monoid) via > Overriding Inventory - > '[ hp via Sum - > , coins via Sum - > , poisoned via Any - > , items via MultiSet Item - > , weapons via MultiSet Weapon - > ] + > '[ hp via Sum + > , coins via Sum + > , poisoned via Any + > , items via MultiSet Item + > , weapons via MultiSet Weapon + > ] Synthesis runs once per instance (not per use): @deriving Cls via Stock T@ produces a single shared @instance Cls T@ that every call reuses.
revision 11
name: stock version: 0.1.0.0 synopsis: Stock-style deriving via coercion, with no Generic -x-revision: 10 +x-revision: 11 description: A GHC type-checker plugin that derives class instances for __@<https://hackage-content.haskell.org/package/stock-0.1.0.0/docs/Stock.html#t:Stock Stock T>@__ and higher-kinded variants at /compile time/, straight from the structure of /T/ without a @Generic@ representation or - runtime cost. Synthesized instances emulate GHC's stock @deriving@. + runtime cost. Synthesized instances emulate GHC's /stock/ deriving. Supported classes:
revision 12
name: stock version: 0.1.0.0 synopsis: Stock-style deriving via coercion, with no Generic -x-revision: 11 +x-revision: 12 description: A GHC type-checker plugin that derives class instances for __@<https://hackage-content.haskell.org/package/stock-0.1.0.0/docs/Stock.html#t:Stock Stock T>@__ and higher-kinded variants at /compile time/, straight @<https://hackage-content.haskell.org/package/base-4.22.0.0/docs/Data-Traversable.html#t:Traversable Traversable>@, @<https://hackage-content.haskell.org/package/base-4.22.0.0/docs/Data-Bitraversable.html#t:Bitraversable Bitraversable>@ - are supported by but cannot be derived via. + are synthesisable but cannot be derived via. Companion packages add more classes through @DeriveStock@ instances (see "Stock.Derive"), discovered automatically without an extra
revision 13
name: stock version: 0.1.0.0 synopsis: Stock-style deriving via coercion, with no Generic -x-revision: 12 +x-revision: 13 description: A GHC type-checker plugin that derives class instances for __@<https://hackage-content.haskell.org/package/stock-0.1.0.0/docs/Stock.html#t:Stock Stock T>@__ and higher-kinded variants at /compile time/, straight * __@<https://hackage-content.haskell.org/package/stock-0.1.0.0/docs/Stock.html#t:Stock2 Stock2>@__: @<https://hackage-content.haskell.org/package/base-4.22.0.0/docs/Data-Bifunctor.html#t:Bifunctor Bifunctor>@, @<https://hackage-content.haskell.org/package/base-4.22.0.0/docs/Data-Bifoldable.html#t:Bifoldable Bifoldable>@, @<https://hackage-content.haskell.org/package/base-4.22.0.0/docs/Data-Bitraversable.html#t:Bitraversable Bitraversable>@, @<https://hackage-content.haskell.org/package/base-4.22.0.0/docs/Data-Functor-Classes.html#t:Eq2 Eq2>@, @<https://hackage-content.haskell.org/package/base-4.22.0.0/docs/Data-Functor-Classes.html#t:Ord2 Ord2>@, @<https://hackage-content.haskell.org/package/base-4.22.0.0/docs/Data-Functor-Classes.html#t:Show2 Show2>@, @<https://hackage-content.haskell.org/package/base-4.22.0.0/docs/Data-Functor-Classes.html#t:Read2 Read2>@, @<https://hackage-content.haskell.org/package/base-4.22.0.0/docs/Control-Category.html#t:Category Category>@ - @<https://hackage-content.haskell.org/package/base-4.22.0.0/docs/Data-Traversable.html#t:Traversable Traversable>@, + @<https://hackage-content.haskell.org/package/base-4.22.0.0/docs/Data-Traversable.html#t:Traversable Traversable>@, @<https://hackage-content.haskell.org/package/base-4.22.0.0/docs/Data-Bitraversable.html#t:Bitraversable Bitraversable>@ - are synthesisable but cannot be derived via. + are synthesisable but cannot be used with @DerivingVia@ due to role + issues. Companion packages add more classes through @DeriveStock@ instances (see "Stock.Derive"), discovered automatically without an extra > import Stock > import Data.Ord (Down(..)) > - > -- >>> sort [Bronze, Silver, Gold] + > -- >>> sort [Bronze,Silver,Gold] > -- [Gold,Silver,Bronze] > data Place = Bronze | Silver | Gold > deriving (Eq, Show) via Stock Place
revision 14
name: stock version: 0.1.0.0 synopsis: Stock-style deriving via coercion, with no Generic -x-revision: 13 +x-revision: 14 description: A GHC type-checker plugin that derives class instances for __@<https://hackage-content.haskell.org/package/stock-0.1.0.0/docs/Stock.html#t:Stock Stock T>@__ and higher-kinded variants at /compile time/, straight * __@<https://hackage-content.haskell.org/package/stock-0.1.0.0/docs/Stock.html#t:Stock Stock>@__: @<https://hackage-content.haskell.org/package/base-4.22.0.0/docs/Data-Eq.html#t:Eq Eq>@, @<https://hackage-content.haskell.org/package/base-4.22.0.0/docs/Data-Ord.html#t:Ord Ord>@, @<https://hackage-content.haskell.org/package/base-4.22.0.0/docs/Text-Show.html#t:Show Show>@, @<https://hackage-content.haskell.org/package/base-4.22.0.0/docs/Text-Read.html#t:Read Read>@, @<https://hackage-content.haskell.org/package/base-4.22.0.0/docs/Data-Semigroup.html#t:Semigroup Semigroup>@, @<https://hackage-content.haskell.org/package/base-4.22.0.0/docs/Data-Monoid.html#t:Monoid Monoid>@, @<https://hackage-content.haskell.org/package/base-4.22.0.0/docs/Prelude.html#t:Enum Enum>@, @<https://hackage-content.haskell.org/package/base-4.22.0.0/docs/Prelude.html#t:Bounded Bounded>@, @<https://hackage-content.haskell.org/package/base-4.22.0.0/docs/Data-Ix.html#t:Ix Ix>@, @<https://hackage-content.haskell.org/package/base-4.22.0.0/docs/GHC-Generics.html#t:Generic Generic>@ - * __@<https://hackage-content.haskell.org/package/stock-0.1.0.0/docs/Stock.html#t:Stock1 Stock1>@__: @<https://hackage-content.haskell.org/package/base-4.22.0.0/docs/Data-Functor.html#t:Functor Functor>@, @<https://hackage-content.haskell.org/package/base-4.22.0.0/docs/Data-Foldable.html#t:Foldable Foldable>@, @<https://hackage-content.haskell.org/package/base-4.22.0.0/docs/Data-Traversable.html#t:Traversable Traversable>@, @<https://hackage-content.haskell.org/package/base-4.22.0.0/docs/Data-Functor-Contravariant.html#t:Contravariant Contravariant>@, + * __@<https://hackage-content.haskell.org/package/stock-0.1.0.0/docs/Stock.html#t:Stock1 Stock1>@__: @<https://hackage-content.haskell.org/package/base-4.22.0.0/docs/Data-Functor.html#t:Functor Functor>@, @<https://hackage-content.haskell.org/package/base-4.22.0.0/docs/Data-Foldable.html#t:Foldable Foldable>@, @<https://hackage-content.haskell.org/package/base-4.22.0.0/docs/Data-Traversable.html#t:Traversable Traversable>@,† @<https://hackage-content.haskell.org/package/base-4.22.0.0/docs/Data-Functor-Contravariant.html#t:Contravariant Contravariant>@, @<https://hackage-content.haskell.org/package/base-4.22.0.0/docs/Control-Applicative.html#t:Applicative Applicative>@, @<https://hackage-content.haskell.org/package/base-4.22.0.0/docs/Data-Functor-Classes.html#t:Eq1 Eq1>@, @<https://hackage-content.haskell.org/package/base-4.22.0.0/docs/Data-Functor-Classes.html#t:Ord1 Ord1>@, @<https://hackage-content.haskell.org/package/base-4.22.0.0/docs/Data-Functor-Classes.html#t:Show1 Show1>@, @<https://hackage-content.haskell.org/package/base-4.22.0.0/docs/Data-Functor-Classes.html#t:Read1 Read1>@, @<https://hackage-content.haskell.org/package/base-4.22.0.0/docs/GHC-Generics.html#t:Generic1 Generic1>@, @<https://hackage-content.haskell.org/package/base-4.22.0.0/docs/Data-Type-Equality.html#t:TestEquality TestEquality>@, @<https://hackage-content.haskell.org/package/base-4.22.0.0/docs/Data-Type-Coercion.html#t:TestCoercion TestCoercion>@ - * __@<https://hackage-content.haskell.org/package/stock-0.1.0.0/docs/Stock.html#t:Stock2 Stock2>@__: @<https://hackage-content.haskell.org/package/base-4.22.0.0/docs/Data-Bifunctor.html#t:Bifunctor Bifunctor>@, @<https://hackage-content.haskell.org/package/base-4.22.0.0/docs/Data-Bifoldable.html#t:Bifoldable Bifoldable>@, @<https://hackage-content.haskell.org/package/base-4.22.0.0/docs/Data-Bitraversable.html#t:Bitraversable Bitraversable>@, @<https://hackage-content.haskell.org/package/base-4.22.0.0/docs/Data-Functor-Classes.html#t:Eq2 Eq2>@, + * __@<https://hackage-content.haskell.org/package/stock-0.1.0.0/docs/Stock.html#t:Stock2 Stock2>@__: @<https://hackage-content.haskell.org/package/base-4.22.0.0/docs/Data-Bifunctor.html#t:Bifunctor Bifunctor>@, @<https://hackage-content.haskell.org/package/base-4.22.0.0/docs/Data-Bifoldable.html#t:Bifoldable Bifoldable>@, @<https://hackage-content.haskell.org/package/base-4.22.0.0/docs/Data-Bitraversable.html#t:Bitraversable Bitraversable>@,† @<https://hackage-content.haskell.org/package/base-4.22.0.0/docs/Data-Functor-Classes.html#t:Eq2 Eq2>@, @<https://hackage-content.haskell.org/package/base-4.22.0.0/docs/Data-Functor-Classes.html#t:Ord2 Ord2>@, @<https://hackage-content.haskell.org/package/base-4.22.0.0/docs/Data-Functor-Classes.html#t:Show2 Show2>@, @<https://hackage-content.haskell.org/package/base-4.22.0.0/docs/Data-Functor-Classes.html#t:Read2 Read2>@, @<https://hackage-content.haskell.org/package/base-4.22.0.0/docs/Control-Category.html#t:Category Category>@ - @<https://hackage-content.haskell.org/package/base-4.22.0.0/docs/Data-Traversable.html#t:Traversable Traversable>@, + † @<https://hackage-content.haskell.org/package/base-4.22.0.0/docs/Data-Traversable.html#t:Traversable Traversable>@, @<https://hackage-content.haskell.org/package/base-4.22.0.0/docs/Data-Bitraversable.html#t:Bitraversable Bitraversable>@ are synthesisable but cannot be used with @DerivingVia@ due to role issues.