generic-data 0.9.2.0 → 0.9.2.1
raw patch · 8 files changed
+27/−40 lines, 8 filesdep −QuickCheckdep −doctestdep ~basesetup-changedPVP ok
version bump matches the API change (PVP)
Dependencies removed: QuickCheck, doctest
Dependency ranges changed: base
API changes (from Hackage documentation)
Files
- CHANGELOG.md +5/−0
- README.md +1/−1
- Setup.hs +2/−2
- generic-data.cabal +2/−20
- src/Generic/Data/Internal/Enum.hs +8/−8
- src/Generic/Data/Internal/Generically.hs +8/−2
- src/Generic/Data/Internal/Meta.hs +1/−0
- test/doctest.hs +0/−7
CHANGELOG.md view
@@ -1,3 +1,8 @@+# 0.9.2.1++- No external changes.+- Use cabal-docspec instead of doctest+ # 0.9.2.0 - Add instance of `Bounded` for `FiniteEnumeration` (the same as `Generically`)
README.md view
@@ -38,7 +38,7 @@ import Data.Semigroup (Semigroup(..)) -- generic-data-import Generic.Data (gmappend)+import Generic.Data (Generic, gmappend) import Generic.Data.Orphans () ```
Setup.hs view
@@ -1,2 +1,2 @@-import Distribution.Extra.Doctest (defaultMainWithDoctests)-main = defaultMainWithDoctests "generic-data-doctest"+import Distribution.Simple+main = defaultMain
generic-data.cabal view
@@ -1,5 +1,5 @@ name: generic-data-version: 0.9.2.0+version: 0.9.2.1 synopsis: Deriving instances with GHC.Generics and related utilities description: Generic implementations of standard type classes.@@ -12,16 +12,12 @@ maintainer: lysxia@gmail.com copyright: 2018-2020 Li-yao Xia category: Generics-build-type: Custom+build-type: Simple extra-source-files: README.md, CHANGELOG.md cabal-version: >=1.10 tested-with: GHC == 8.0.2, GHC == 8.2.2, GHC == 8.4.3, GHC == 8.6.1, GHC == 8.6.3, GHC == 8.6.5, GHC == 8.8.2 -custom-setup- setup-depends:- base, Cabal, cabal-doctest >= 1.0.6 && < 1.1- library hs-source-dirs: src exposed-modules:@@ -143,20 +139,6 @@ default-language: Haskell2010 type: exitcode-stdio-1.0 if impl(ghc < 8.2) || os(windows)- buildable: False--test-suite generic-data-doctest- hs-source-dirs: test- main-is: doctest.hs- build-depends:- doctest,- QuickCheck,- generic-data,- base- ghc-options: -Wall- default-language: Haskell2010- type: exitcode-stdio-1.0- if !impl(ghc >= 8.6) buildable: False benchmark bench
src/Generic/Data/Internal/Enum.hs view
@@ -253,26 +253,26 @@ -- | Extends the 'StandardEnum' option for 'GEnum' to allow all constructors to -- have arbitrary many fields. Each field type must be an instance of --- both 'Enum' and 'Bounded'.+-- both 'Enum' and 'Bounded'. Avoid fields of types 'Int' and 'Word'. -- -- === __Details__ ----- Two restrictions require the user's caution:+-- Two restrictions require the user's attention: -- -- * The 'Enum' instances of the field types need to start enumerating from 0. --- Particularly 'Int' is an unfit field type, because the enumeration of the +-- In particular, 'Int' is an unfit field type, because the enumeration of the -- negative values starts before 0. -- -- * There can only be up to @'maxBound' :: 'Int'@ values (because the implementation -- represents the cardinality explicitly as an 'Int'). This restriction makes--- 'Word' an invalid field type. Notably, it is insufficient for each+-- 'Word' an invalid field type as well. Notably, it is insufficient for each -- individual field types to stay below this limit. Instead it applies to the -- generic type as a whole. ----- The resulting 'GEnum' instance starts enumerating from @0@ up to--- @(cardinality - 1)@ and respects the generic 'Ord' instance (defined by--- 'Generic.Data.gcompare'). The values from different constructors are enumerated--- sequentially; they are not interleaved.+-- Elements are numbered by 'toEnum', from @0@ up to @(cardinality - 1)@.+-- The resulting ordering matches the generic 'Ord' instance defined by+-- 'Generic.Data.gcompare'.+-- The values from different constructors are enumerated sequentially. -- -- @ -- data Example = C0 Bool Bool | C1 Bool
src/Generic/Data/Internal/Generically.hs view
@@ -31,13 +31,16 @@ import Generic.Data.Internal.Show import Generic.Data.Internal.Traversable (GFoldable, GTraversable, gfoldMap, gtraverse, gsequenceA) +-- $setup+-- >>> :set -XDerivingVia -XDeriveGeneric+-- >>> import GHC.Generics (Generic, Generic1)+ -- | Type with instances derived via 'Generic'. -- -- === Examples -- -- ==== __Deriving 'Eq', 'Ord', 'Show', 'Read'__ ----- >>> :set -XDerivingVia -XDeriveGeneric -- >>> :{ -- data T = C Int Bool -- deriving Generic@@ -48,6 +51,7 @@ -- -- The type must have only one constructor. --+-- >>> import Data.Monoid (Sum) -- >>> :{ -- data U = D [Int] (Sum Int) -- deriving Generic@@ -164,6 +168,7 @@ -- deriving (Functor, Applicative) via (Generically1 G) -- :} --+-- >>> import Control.Applicative (Alternative) -- >>> :{ -- data G' a = G' (Maybe a) [a] -- deriving Generic1@@ -184,6 +189,7 @@ -- -- ==== __Deriving 'Eq1', 'Ord1'__ --+-- >>> import Data.Functor.Classes (Eq1, Ord1) -- >>> :{ -- data I a = I [a] (Maybe a) -- deriving Generic1@@ -271,7 +277,7 @@ -- -- === __Example__ ----- >>> :set -XDeriveGeneric -XDerivingVia+-- >>> import Data.Monoid (Sum(..)) -- >>> data Point a = Point a a deriving Generic -- >>> :{ -- newtype Vector a = Vector (Point a)
src/Generic/Data/Internal/Meta.hs view
@@ -94,6 +94,7 @@ -- | The fixity of the first constructor. --+-- >>> import GHC.Generics ((:*:)(..)) -- >>> gconFixity (Just 0) -- Prefix -- >>> gconFixity ([] :*: id)
− test/doctest.hs
@@ -1,7 +0,0 @@-module Main (main) where--import Test.DocTest (doctest)-import Build_doctests (flags, pkgs, module_sources)--main :: IO ()-main = doctest (flags ++ pkgs ++ module_sources)