binary-orphans 1 → 1.0.1
raw patch · 3 files changed
+13/−7 lines, 3 filesdep ~QuickCheckdep ~basedep ~binaryPVP ok
version bump matches the API change (PVP)
Dependency ranges changed: QuickCheck, base, binary, semigroups, tasty
API changes (from Hackage documentation)
Files
- CHANGELOG.md +5/−0
- binary-orphans.cabal +2/−2
- src/Data/Binary/Orphans.hs +6/−5
CHANGELOG.md view
@@ -1,3 +1,8 @@+# 1.0.1++- Fix `MonadFail` instances shim+- `NonEmpty` doesn't fail on empty list+ # 1 Stripped down the package to only shim `binary` orphans.
binary-orphans.cabal view
@@ -1,7 +1,7 @@ cabal-version: 1.12 name: binary-orphans-version: 1-synopsis: Compatibility package for @binary@; provides instances.+version: 1.0.1+synopsis: Compatibility package for binary; provides instances category: Data, Binary, Parsing, Compatibility description: This package provides instances defined in later versions of @binary@ package
src/Data/Binary/Orphans.hs view
@@ -160,19 +160,16 @@ -- binary-0.8.2.0 ------------------------------------------------------------------------------- -#if !(MIN_VERSION_binary(0,8,2)) ------------------------------------------------------------------------------- -- When using GHC >= 8, Data.Binary.Get.Get implements MonadFail and delegates its fail to MonadFail.fail. -#if !(MIN_VERSION_base(4,9,0))+#if !(MIN_VERSION_binary(0,8,2)) || !(MIN_VERSION_base(4,9,0)) instance Fail.MonadFail Get where -- this is ok, as if old base: Prelude.fail is Monad's fail fail = Prelude.fail #endif -#endif- ------------------------------------------------------------------------------- -- binary-0.8.3 -------------------------------------------------------------------------------@@ -285,7 +282,11 @@ put (Semigroup.Arg a b) = put a <> put b instance Binary a => Binary (NE.NonEmpty a) where- get = fmap NE.fromList get+ get = do+ x <- get+ case x of+ [] -> fail "empty NonEmpty"+ (x:xs) -> return (x NE.:| xs) put = put . NE.toList #endif