summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--CHANGELOG8
-rw-r--r--Reactive/Banana/Automation.hs13
-rw-r--r--reactive-banana-automation.cabal4
3 files changed, 15 insertions, 10 deletions
diff --git a/CHANGELOG b/CHANGELOG
index cdc9f82..c52471e 100644
--- a/CHANGELOG
+++ b/CHANGELOG
@@ -1,3 +1,11 @@
+reactive-banana-automation (0.5.3) upstream; urgency=medium
+
+ * Prepare for monad of no return, by removing redundant return
+ implementation for Automation.
+ * Remove compatability for ghc older than 8.0.
+
+ -- Joey Hess <id@joeyh.name> Wed, 26 Feb 2020 11:31:40 -0400
+
reactive-banana-automation (0.5.2) upstream; urgency=medium
* Support stm-2.5.
diff --git a/Reactive/Banana/Automation.hs b/Reactive/Banana/Automation.hs
index 24e02b5..52740de 100644
--- a/Reactive/Banana/Automation.hs
+++ b/Reactive/Banana/Automation.hs
@@ -63,7 +63,6 @@ module Reactive.Banana.Automation (
import Reactive.Banana
import Reactive.Banana.Frameworks
-import Data.Semigroup as Sem
import Control.Monad.Fix
import Control.Monad.Trans.Reader
import Control.Monad.Trans.Class
@@ -104,24 +103,22 @@ import Data.Time.LocalTime
newtype Automation sensors actuators a = Automation
{ unAutomation :: ReaderT (sensors, actuators -> IO ()) MomentIO a }
-instance Sem.Semigroup (Automation sensors actuators ()) where
+instance Semigroup (Automation sensors actuators ()) where
Automation a <> Automation b = Automation (a >> b)
instance Monoid (Automation sensors actuators ()) where
mempty = Automation (return ())
- mappend = (Sem.<>)
instance Functor (Automation sensors actuators) where
fmap f = Automation . fmap f . unAutomation
-instance Monad (Automation sensors actuators) where
- return = Automation . return
- m >>= g = Automation $ unAutomation m >>= unAutomation . g
-
instance Applicative (Automation sensors actuators) where
pure = Automation . pure
f <*> a = Automation $ unAutomation f <*> unAutomation a
+instance Monad (Automation sensors actuators) where
+ m >>= g = Automation $ unAutomation m >>= unAutomation . g
+
instance MonadFix (Automation sensors actuators) where
mfix f = Automation $ mfix (unAutomation . f)
@@ -433,7 +430,7 @@ instance Show t => Show (Range t) where
-- | Combining two ranges yields a range between their respective lowest
-- and highest values.
-instance Ord t => Sem.Semigroup (Range t) where
+instance Ord t => Semigroup (Range t) where
Range a1 b1 <> Range a2 b2 =
let vals = [a1, b1, a2, b2]
in Range (minimum vals) (maximum vals)
diff --git a/reactive-banana-automation.cabal b/reactive-banana-automation.cabal
index 6c1e6ae..e8f1b1a 100644
--- a/reactive-banana-automation.cabal
+++ b/reactive-banana-automation.cabal
@@ -1,5 +1,5 @@
Name: reactive-banana-automation
-Version: 0.5.2
+Version: 0.5.3
Cabal-Version: >= 1.8
License: AGPL-3
Maintainer: Joey Hess <id@joeyh.name>
@@ -29,7 +29,7 @@ source-repository head
Library
ghc-Options: -Wall -fno-warn-tabs
Build-Depends:
- base (>= 4.6 && < 5.0),
+ base (>= 4.9 && < 5.0),
reactive-banana (>= 1.1 && < 1.3),
time (>= 1.6 && < 1.9),
stm (>= 2.4 && < 2.6),