atom-conduit 0.8.0.0 → 0.9.0.0
raw patch · 3 files changed
+16/−15 lines, 3 filesdep ~refinedPVP ok
version bump matches the API change (PVP)
Dependency ranges changed: refined
API changes (from Hackage documentation)
- Text.Atom.Types: instance Refined.Internal.Predicate Text.Atom.Types.Null Data.Text.Internal.Text
+ Text.Atom.Types: instance Refined.Predicate Text.Atom.Types.Null Data.Text.Internal.Text
Files
- atom-conduit.cabal +5/−5
- src/Text/Atom/Types.hs +3/−1
- test/QuickCheck.hs +8/−9
atom-conduit.cabal view
@@ -1,6 +1,6 @@ cabal-version: 2.2 name: atom-conduit-version: 0.8.0.0+version: 0.9.0.0 build-type: Simple license: CC0-1.0 license-file: LICENSE@@ -10,7 +10,7 @@ synopsis: Streaming parser/renderer for the Atom 1.0 standard (RFC 4287). description: Cf README. category: XML, Conduit-tested-with: GHC <8.10 && >=8.4.2+tested-with: GHC <8.12 && >=8.4.2 extra-source-files: README.md @@ -46,7 +46,7 @@ microlens-th, parsers, prettyprinter,- refined >=0.2,+ refined >=0.5, safe-exceptions, text, time >=1.5,@@ -66,7 +66,7 @@ generic-random, QuickCheck, quickcheck-instances,- refined >=0.2,+ refined >=0.5, tasty, tasty-quickcheck, time >=1.5,@@ -102,7 +102,7 @@ conduit >=1.3, data-default, microlens,- refined >=0.2,+ refined >=0.5, resourcet, tasty, tasty-hunit,
src/Text/Atom/Types.hs view
@@ -49,7 +49,9 @@ data Null deriving(Typeable) instance Predicate Null Text where- validate p value = unless (Text.null value) $ throwRefine $ RefineOtherException (typeOf p) $ "Text is not null: " <> pretty value+ validate p value = if not $ Text.null value+ then pure $ RefineOtherException (typeOf p) $ "Text is not null: " <> value+ else Nothing data AtomURI = forall a . AtomURI (URIRef a)
test/QuickCheck.hs view
@@ -3,12 +3,13 @@ import Control.Monad import Data.Char import Data.Conduit-import Data.Text as Text (Text, pack, null)+import Data.Text as Text (Text, null, pack) import Data.Time.Clock import Data.Void import Data.XML.Types as XML import Generic.Random import Refined+import Refined.Unsafe (reallyUnsafeRefine) import Test.QuickCheck.Instances import Test.QuickCheck.Modifiers import Test.Tasty@@ -70,11 +71,6 @@ return $ UTCTime d (fromIntegral (round s :: Int)) -instance Arbitrary (Refined (Not Null) Text) where- arbitrary = do- ~(Right text) <- refine <$> arbitrary `suchThat` (not . Text.null)- return text- instance Arbitrary Scheme where arbitrary = do a <- getLetter <$> arbitrary@@ -172,16 +168,19 @@ mergeNodes (node:t) = node:mergeNodes t mergeNodes [] = [] +genNotNullText :: Gen (Refined (Not Null) Text)+genNotNullText = reallyUnsafeRefine <$> arbitrary `suchThat` (not . Text.null)+ instance Arbitrary AtomText where arbitrary = genericArbitrary uniform shrink = genericShrink instance Arbitrary AtomPerson where- arbitrary = genericArbitrary uniform+ arbitrary = AtomPerson <$> genNotNullText <*> arbitrary <*> arbitrary shrink = genericShrink instance Arbitrary AtomCategory where- arbitrary = genericArbitrary uniform+ arbitrary = AtomCategory <$> genNotNullText <*> arbitrary <*> arbitrary shrink = genericShrink instance Arbitrary AtomLink where@@ -189,7 +188,7 @@ shrink = genericShrink instance Arbitrary AtomGenerator where- arbitrary = genericArbitrary uniform+ arbitrary = AtomGenerator <$> arbitrary <*> arbitrary <*> genNotNullText shrink = genericShrink instance Arbitrary AtomSource where