packages feed

chatty 0.4.1.0 → 0.5.0.0

raw patch · 3 files changed

+10/−7 lines, 3 files

Files

Text/Chatty/Channel/Broadcast.hs view
@@ -32,6 +32,11 @@  -- | Typeclass for all channel printers that may broadcast to all channels that fulfill a condition. class ChannelPrinter c m => Broadcaster c m where+    -- | Print the string to all channels that fulfill the current condition.+  bprint :: (c -> m Bool) -> String -> m ()++-- | Typeclass for all broadcaster that may embrace sections+class Broadcaster c m => BroadcasterBracket c m where   -- | Run the function and print to all channels that fulfill the given condition.   bbracket :: (c -> m Bool) -> m a -> m a   bbracket f m = bstart f >> m >>= \a -> bfin f >> return a@@ -39,6 +44,3 @@   bstart :: (c -> m Bool) -> m ()   -- | Return to the previous condition. The argument is bogus (just for type inference).   bfin :: (c -> m Bool) -> m ()-  -- | Print the string to all channels that fulfill the current condition.-  bprint :: (c -> m Bool) -> String -> m ()-  bprint f str = bbracket f $ mprint str
Text/Chatty/Interactor/Templates.hs view
@@ -90,9 +90,10 @@ mkBroadcaster :: Name -> Name -> Q [Dec] mkBroadcaster c s = [d|     instance Broadcaster $cx m => Broadcaster $cx ($sx m) where-      bstart = lift . bstart-      bfin = lift . bfin-      bprint b = lift . bprint b+      bprint b = lift . bprint (lift . b)+    instance BroadcasterBracket $cx m => BroadcasterBracket $cx ($sx m) where+      bstart b = lift $ bstart (lift . b)+      bfin b = lift $ bfin (lift . b)   |]   where sx = strToType s         cx = strToType c-}
chatty.cabal view
@@ -10,7 +10,7 @@ -- PVP summary:      +-+------- breaking API changes --                   | | +----- non-breaking API additions --                   | | | +--- code changes with no API change-version:             0.4.1.0+version:             0.5.0.0  -- A short (one-line) description of the package. synopsis:            Some monad transformers and typeclasses to simplify I/O on a transformer stack.