packages feed

moffy-samples-events 0.2.1.0 → 0.2.2.0

raw patch · 2 files changed

+12/−3 lines, 2 filesPVP: major bump suggested

API removals or changes: PVP suggests a major version bump

API changes (from Hackage documentation)

+ Control.Moffy.Samples.Run.TChan: interpretSt' :: (MonadIO m, Adjustable es es', Ord k) => HandleSt st m es' -> TVar (Map k v) -> TChan a -> Sig s es ((k, v), a) r -> St st m r
- Control.Moffy.Samples.Run.TChan: interpret :: (Monad m, MonadIO m, Adjustable es es') => Handle m es' -> TChan a -> Sig s es a r -> m r
+ Control.Moffy.Samples.Run.TChan: interpret :: (MonadIO m, Adjustable es es') => Handle m es' -> TChan a -> Sig s es a r -> m r
- Control.Moffy.Samples.Run.TChan: interpretSt :: (Monad m, MonadIO m, Adjustable es es') => HandleSt st m es' -> TChan a -> Sig s es a r -> St st m r
+ Control.Moffy.Samples.Run.TChan: interpretSt :: (MonadIO m, Adjustable es es') => HandleSt st m es' -> TChan a -> Sig s es a r -> St st m r

Files

moffy-samples-events.cabal view
@@ -5,7 +5,7 @@ -- see: https://github.com/sol/hpack  name:           moffy-samples-events-version:        0.2.1.0+version:        0.2.2.0 synopsis:       Events for sample codes of moffy description:    Please see the README on GitHub at <https://github.com/YoshikuniJujo/moffy-samples-events#readme> category:       Control
src/Control/Moffy/Samples/Run/TChan.hs view
@@ -1,3 +1,4 @@+{-# LANGUAGE BlockArguments #-} {-# OPTIONS_GHC -Wall -fno-warn-tabs #-}  module Control.Moffy.Samples.Run.TChan where@@ -9,10 +10,18 @@  import qualified Control.Moffy.Run as M -interpret :: (Monad m, MonadIO m, Adjustable es es') =>+import Data.Map++interpret :: (MonadIO m, Adjustable es es') => 	Handle m es' -> TChan a -> Sig s es a r -> m r interpret h c = M.interpret h (liftIO . atomically . writeTChan c) -interpretSt :: (Monad m, MonadIO m, Adjustable es es') =>+interpretSt :: (MonadIO m, Adjustable es es') => 	HandleSt st m es' -> TChan a -> Sig s es a r -> St st m r interpretSt h c = M.interpretSt h (liftIO . atomically . writeTChan c)++interpretSt' :: (MonadIO m, Adjustable es es', Ord k) =>+	HandleSt st m es' -> TVar (Map k v) -> TChan a -> Sig s es ((k, v), a) r -> St st m r+interpretSt' h vm c = M.interpretSt h \((k, v), x) -> liftIO $ atomically do+	modifyTVar vm $ insert k v+	writeTChan c x