Skip to content
Snippets Groups Projects
Commit 957ee321 authored by Ben Gamari's avatar Ben Gamari :turtle:
Browse files

Update streaming-0.2.2.0 patch from upstream

From streaming commit a59174400842f6446eefd4b83e1951696ecdf4e1
parent 7c7facab
No related branches found
No related tags found
No related merge requests found
diff -ru streaming-0.2.2.0.orig/src/Streaming/Internal.hs streaming-0.2.2.0/src/Streaming/Internal.hs commit 93324cf750bc289bb1cb8c1f0087367a8510c23d
--- streaming-0.2.2.0.orig/src/Streaming/Internal.hs 1969-12-31 19:00:00.000000000 -0500 Author: Ben Gamari <ben@smart-cactus.org>
+++ streaming-0.2.2.0/src/Streaming/Internal.hs 2019-05-02 15:48:52.108061100 -0400 Date: Mon Jul 15 13:34:47 2019 -0400
@@ -91,6 +91,7 @@
Adjust for base 4.13 MonadFail changes.
Adds a MonadFail instance for Stream as well
as removing fail from the Monad instance under
base 4.13.
diff --git a/changelog.md b/changelog.md
index 666ee3a..dac7930 100644
--- a/changelog.md
+++ b/changelog.md
@@ -19,6 +19,10 @@
Generalise type signature of `toList_`.
+ Compatibility with base 4.13.
+
+ Provide a MonadFail instance for Stream.
+
- 0.2.1.0
Adding `Semigroup` instances for GHC 8.4.
diff --git a/src/Streaming/Internal.hs b/src/Streaming/Internal.hs
index a789f68..cd6f7b4 100644
--- a/src/Streaming/Internal.hs
+++ b/src/Streaming/Internal.hs
@@ -91,6 +91,7 @@ import Control.Monad.Trans
import Control.Monad.Reader.Class import Control.Monad.Reader.Class
import Control.Monad.State.Class import Control.Monad.State.Class
import Control.Monad.Error.Class import Control.Monad.Error.Class
+import qualified Control.Monad.Fail as Fail +import Control.Monad.Fail as Fail
import Control.Applicative import Control.Applicative
import Data.Function ( on ) import Data.Function ( on )
import Control.Monad.Morph import Control.Monad.Morph
@@ -244,9 +245,14 @@ @@ -244,9 +245,14 @@ instance (Functor f, Monad m) => Monad (Stream f m) where
Return r -> f r Return r -> f r
{-# INLINABLE (>>=) #-} {-# INLINABLE (>>=) #-}
- fail = lift . fail
- {-#INLINE fail #-}
+#if !(MIN_VERSION_base(4,13,0)) +#if !(MIN_VERSION_base(4,13,0))
fail = lift . fail + fail = lift . Prelude.fail
{-#INLINE fail #-} + {-# INLINE fail #-}
+#endif +#endif
+instance (Functor f, MonadFail m) => MonadFail (Stream f m) where +instance (Functor f, MonadFail m) => MonadFail (Stream f m) where
...@@ -24,3 +52,17 @@ diff -ru streaming-0.2.2.0.orig/src/Streaming/Internal.hs streaming-0.2.2.0/src/ ...@@ -24,3 +52,17 @@ diff -ru streaming-0.2.2.0.orig/src/Streaming/Internal.hs streaming-0.2.2.0/src/
-- _bind -- _bind
-- :: (Functor f, Monad m) -- :: (Functor f, Monad m)
diff --git a/streaming.cabal b/streaming.cabal
index cfc3a13..a1d0433 100644
--- a/streaming.cabal
+++ b/streaming.cabal
@@ -222,5 +222,9 @@ library
, transformers-base < 0.5
, ghc-prim
, containers
+
+ if !impl(ghc >= 8.0)
+ build-depends: fail == 4.9.*
+
hs-source-dirs: src
default-language: Haskell2010
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment