opml-conduit 0.8.0.0 → 0.9.0.0
raw patch · 3 files changed
+9/−12 lines, 3 filesdep ~refinedPVP ok
version bump matches the API change (PVP)
Dependency ranges changed: refined
API changes (from Hackage documentation)
- Text.OPML.Types: instance Refined.Internal.Predicate Text.OPML.Types.Null Data.Text.Internal.Text
+ Text.OPML.Types: instance Refined.Predicate Text.OPML.Types.Null Data.Text.Internal.Text
Files
- Text/OPML/Types.hs +3/−1
- opml-conduit.cabal +3/−3
- test/Arbitrary.hs +3/−8
Text/OPML/Types.hs view
@@ -54,7 +54,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"+ validate p value = if not $ Text.null value+ then pure $ RefineOtherException (typeOf p) "Text is not null"+ else Nothing data OpmlHead = OpmlHead { opmlTitle :: Text
opml-conduit.cabal view
@@ -1,5 +1,5 @@ name: opml-conduit-version: 0.8.0.0+version: 0.9.0.0 synopsis: Streaming parser/renderer for the OPML 2.0 format. description: This library implements the OPML 2.0 standard (<http://dev.opml.org/spec2.html>) as a 'conduit' parser/renderer.@@ -46,7 +46,7 @@ , microlens , microlens-th , monoid-subclasses- , refined >= 0.2+ , refined >= 0.5 , semigroups , text , time >= 1.5@@ -77,7 +77,7 @@ , parsers , QuickCheck , quickcheck-instances- , refined >= 0.2+ , refined >= 0.5 , resourcet , semigroups , tasty
test/Arbitrary.hs view
@@ -14,7 +14,7 @@ import Data.Char import Data.List.NonEmpty import Data.Maybe-import Data.Text as Text (Text, find, null, pack)+import Data.Text as Text (Text, find, pack) import Data.Text.Encoding import Data.Time.Clock import Data.Tree@@ -95,12 +95,7 @@ genAlphaNum :: Gen Char genAlphaNum = oneof [choose('a', 'z'), suchThat arbitrary isDigit] -instance Arbitrary (Refined (Not Null) Text) where- arbitrary = do- ~(Right t) <- refine <$> arbitrary `suchThat` (not . Text.null)- return t - instance Arbitrary OpmlHead where arbitrary = OpmlHead <$> arbitrary <*> (Just <$> genTime)@@ -160,6 +155,6 @@ root <- arbitrary degree <- choose (0, 100) case (n > 1, root) of- (True, OpmlOutlineGeneric _ _) -> Node <$> pure root <*> vectorOf degree (genOutlineTree (n-1))+ (True, OpmlOutlineGeneric _ _) -> Node <$> pure root <*> vectorOf degree (genOutlineTree (n-1)) (False, OpmlOutlineGeneric _ _) -> return $ Node root []- _ -> return $ Node root []+ _ -> return $ Node root []