packages feed

monad-schedule 0.2.0.1 → 0.2.0.2

raw patch · 4 files changed

+15/−10 lines, 4 filesdep ~base-compatPVP: major bump suggested

API removals or changes: PVP suggests a major version bump

Dependency ranges changed: base-compat

API changes (from Hackage documentation)

- Control.Monad.Schedule.Class: instance (GHC.Base.Monad m, Control.Monad.Schedule.Class.MonadSchedule m) => Control.Monad.Schedule.Class.MonadSchedule (Control.Monad.Trans.Except.ExceptT e m)
- Control.Monad.Schedule.Class: instance (GHC.Base.Monad m, Control.Monad.Schedule.Class.MonadSchedule m) => Control.Monad.Schedule.Class.MonadSchedule (Control.Monad.Trans.Maybe.MaybeT m)
- Control.Monad.Schedule.Class: instance (GHC.Base.Monoid w, GHC.Base.Monad m, Control.Monad.Schedule.Class.MonadSchedule m) => Control.Monad.Schedule.Class.MonadSchedule (Control.Monad.Trans.Accum.AccumT w m)
+ Control.Monad.Schedule.Class: instance (GHC.Base.Applicative m, Control.Monad.Schedule.Class.MonadSchedule m) => Control.Monad.Schedule.Class.MonadSchedule (Control.Monad.Trans.Except.ExceptT e m)
+ Control.Monad.Schedule.Class: instance (GHC.Base.Applicative m, Control.Monad.Schedule.Class.MonadSchedule m) => Control.Monad.Schedule.Class.MonadSchedule (Control.Monad.Trans.Maybe.MaybeT m)
+ Control.Monad.Schedule.Class: instance (GHC.Base.Monoid w, GHC.Base.Functor m, Control.Monad.Schedule.Class.MonadSchedule m) => Control.Monad.Schedule.Class.MonadSchedule (Control.Monad.Trans.Accum.AccumT w m)
- Control.Monad.Schedule.Class: race :: (Monad m, MonadSchedule m) => m a -> m b -> m (Either (a, m b) (m a, b))
+ Control.Monad.Schedule.Class: race :: (Applicative m, MonadSchedule m) => m a -> m b -> m (Either (a, m b) (m a, b))

Files

CHANGELOG.md view
@@ -1,5 +1,10 @@ # Revision history for monad-schedule +## 0.2.0.2++* Relax some type signatures+* Relax some version bounds (thanks Andreas Ländle)+ ## 0.2.0.1  * Compatibility with GHC 9.10
monad-schedule.cabal view
@@ -1,6 +1,6 @@ cabal-version:   2.4 name:            monad-schedule-version:         0.2.0.1+version:         0.2.0.2 license:         MIT license-file:    LICENSE author:          Manuel Bärenz@@ -31,7 +31,7 @@ common deps   build-depends:     , base          >=4.16.0 && <4.21.0-    , base-compat   ^>=0.13+    , base-compat   >=0.13 && < 0.15     , free          >=5.1 && < 5.3     , stm           ^>=2.5     , time-domain   ^>=0.1
src/Control/Monad/Schedule/Class.hs view
@@ -182,7 +182,7 @@   Pass the same initial environment to all actions   and write to the log in the order of scheduling in @m@. -}-instance (Monoid w, Monad m, MonadSchedule m) => MonadSchedule (AccumT w m) where+instance (Monoid w, Functor m, MonadSchedule m) => MonadSchedule (AccumT w m) where   schedule actions = AccumT $ \w ->     fmap (`runAccumT` w) actions       & schedule@@ -199,7 +199,7 @@ {- | Schedule all actions according to @m@ and in case of exceptions   throw the first exception of the immediately returning actions. -}-instance (Monad m, MonadSchedule m) => MonadSchedule (ExceptT e m) where+instance (Applicative m, MonadSchedule m) => MonadSchedule (ExceptT e m) where   schedule =     fmap runExceptT       >>> schedule@@ -209,7 +209,7 @@       extrudeEither :: (Either e a, b) -> Either e (a, b)       extrudeEither (ea, b) = (,b) <$> ea -instance (Monad m, MonadSchedule m) => MonadSchedule (MaybeT m) where+instance (Applicative m, MonadSchedule m) => MonadSchedule (MaybeT m) where   schedule =     fmap (maybeToExceptT ())       >>> schedule@@ -227,17 +227,17 @@   and a continuation for the other value. -} race ::-  (Monad m, MonadSchedule m) =>+  (Applicative m, MonadSchedule m) =>   m a ->   m b ->   m (Either (a, m b) (m a, b)) race aM bM = recoverResult <$> schedule ((Left <$> aM) :| [Right <$> bM])   where-    recoverResult :: (Monad m) => (NonEmpty (Either a b), [m (Either a b)]) -> Either (a, m b) (m a, b)+    recoverResult :: (Applicative m) => (NonEmpty (Either a b), [m (Either a b)]) -> Either (a, m b) (m a, b)     recoverResult (Left a :| [], [bM']) = Left (a, fromRight e <$> bM')     recoverResult (Right b :| [], [aM']) = Right (fromLeft e <$> aM', b)-    recoverResult (Left a :| [Right b], []) = Left (a, return b)-    recoverResult (Right b :| [Left a], []) = Right (return a, b)+    recoverResult (Left a :| [Right b], []) = Left (a, pure b)+    recoverResult (Right b :| [Left a], []) = Right (pure a, b)     recoverResult _ = e     e = error "race: Internal error" 
src/Control/Monad/Schedule/Trans.hs view
@@ -155,7 +155,7 @@         ([], []) -> error "ScheduleT.shiftListOnce: Internal error. Please report as a bug: https://github.com/turion/monad-schedule/issues/new"        -- Repeatedly shift the list by the smallest available waiting duration-      -- until one action returns as pure.+      -- until some actions return as pure.       -- Return its result, together with the remaining free actions.       shiftList ::         (TimeDifference diff, Ord diff, Monad m, MonadSchedule m) =>