packages feed

bson 0.4.0.0 → 0.4.0.1

raw patch · 4 files changed

+29/−6 lines, 4 filesPVP ok

version bump matches the API change (PVP)

API changes (from Hackage documentation)

Files

CHANGELOG.md view
@@ -1,6 +1,11 @@ # Change Log All notable changes to this project will be documented in this file. This project adheres to [Package Versioning Policy](https://wiki.haskell.org/Package_versioning_policy).+## [0.4.0.1] - 2020-03-22++### Fixed+- MonadFail usage+ ## [0.4.0.0] - 2020-02-08  ### Fixed
Data/Bson.hs view
@@ -25,12 +25,12 @@   ObjectId(..), timestamp, genObjectId, showHexLen ) where -import Prelude hiding (lookup)+import Prelude hiding (fail, lookup) #if !MIN_VERSION_base(4,8,0) import Control.Applicative ((<$>)) #endif-#if !MIN_VERSION_base(4,13,0)-import Control.Monad.Fail (MonadFail)+#if MIN_VERSION_base(4, 9, 0)+import Control.Monad.Fail (MonadFail(fail)) #endif import Control.Monad (foldM) import Data.Bits (shift, (.|.))
bson.cabal view
@@ -1,5 +1,5 @@ Name:          bson-Version:       0.4.0.0+Version:       0.4.0.1 Synopsis:      BSON documents are JSON-like objects with a standard binary                encoding. Description:   A BSON Document is an untyped (dynamically type-checked) record.
tests/Data/Bson/Tests.hs view
@@ -1,4 +1,4 @@-{-# LANGUAGE TypeSynonymInstances #-}+{-# LANGUAGE FlexibleInstances, OverloadedStrings, TypeSynonymInstances #-}  module Data.Bson.Tests     ( tests@@ -7,6 +7,9 @@ #if !MIN_VERSION_base(4,8,0) import Control.Applicative ((<$>), (<*>)) #endif+#if MIN_VERSION_base(4,9,0)+import Control.Monad.Fail(MonadFail(..))+#endif import Data.Int (Int32, Int64) import Data.Time.Calendar (Day(ModifiedJulianDay)) import Data.Time.Clock.POSIX (POSIXTime)@@ -16,7 +19,7 @@ import Data.Text (Text) import Test.Framework (Test, testGroup) import Test.Framework.Providers.QuickCheck2 (testProperty)-import Test.QuickCheck (Arbitrary(..), elements, oneof)+import Test.QuickCheck (Arbitrary(..), elements, oneof, Property, (===)) import qualified Data.Text as T  import Data.Bson (Val(cast', val), ObjectId(..), MinMaxKey(..), MongoStamp(..),@@ -106,6 +109,17 @@     Nothing -> False     Just a' -> a == a' +#if MIN_VERSION_base(4,9,0)+instance MonadFail (Either String) where+   fail = Left++testLookMonadFail :: Property+testLookMonadFail =+   (Bson.look "key" [] :: Either String Value)+      -- This is as opposed to an exception thrown from Prelude.fail:+      === Left "expected \"key\" in []"+#endif+ tests :: Test tests = testGroup "Data.Bson.Tests"     [ testProperty "Val Bool"        (testVal :: Bool -> Bool)@@ -131,4 +145,8 @@     , testProperty "Val Binary"      (testVal :: Binary -> Bool)     -- , testProperty "Val Document"    (testVal :: Document -> Bool)     , testProperty "Val Text"        (testVal :: Text -> Bool)++#if MIN_VERSION_base(4,9,0)+    , testProperty "'look' uses MonadFail.fail" testLookMonadFail+#endif     ]