chatty 0.5.0.0 → 0.5.1.0
raw patch · 3 files changed
+33/−5 lines, 3 files
Files
- Text/Chatty/Channel/Printer.hs +28/−1
- Text/Chatty/Interactor.hs +4/−3
- chatty.cabal +1/−1
Text/Chatty/Channel/Printer.hs view
@@ -31,7 +31,8 @@ FilterT (..), IntFilterT, BoolFilterT,- HandleFilterT+ HandleFilterT,+ JoinerT (..) ) where import Control.Arrow@@ -128,3 +129,29 @@ type IntFilterT = FilterT Int type BoolFilterT = FilterT Bool type HandleFilterT = FilterT Handle++-- | Joins all output regardless of its channel.+newtype JoinerT m a = Joiner { runJoinerT :: m a }++instance Monad m => Monad (JoinerT m) where+ return a = Joiner $ return a+ (Joiner j) >>= f = Joiner $ do a <- j; runJoinerT (f a)++instance MonadTrans JoinerT where+ lift = Joiner++instance MonadIO m => MonadIO (JoinerT m) where+ liftIO = lift . liftIO++instance Functor m => Functor (JoinerT m) where+ fmap f (Joiner j) = Joiner $ fmap f j++instance MonadPrinter m => MonadPrinter (JoinerT m) where+ mprint = lift . mprint++instance (Eq c,MonadPrinter m) => ChannelPrinter c (JoinerT m) where+ cstart _ = return ()+ cfin _ = return ()+ cbracket _ m = m+ cthis = return undefined+ cprint _ s = mprint s
Text/Chatty/Interactor.hs view
@@ -58,9 +58,10 @@ mkInteractor ''IntArchiverT mkArchiver mkInteractor ''BoolArchiverT mkArchiver mkInteractor ''HandleArchiverT mkArchiver-mkInteractor ''IntFilterT mkArchiver mkExtendedPrinter-mkInteractor ''BoolFilterT mkArchiver mkExtendedPrinter-mkInteractor ''HandleFilterT mkArchiver mkExtendedPrinter+mkInteractor ''IntFilterT mkArchiver+mkInteractor ''BoolFilterT mkArchiver+mkInteractor ''HandleFilterT mkArchiver+mkInteractor ''JoinerT mkArchiver -- | IgnorantT ignores all output and does not provide any input. type IgnorantT m = QuietT (DeafT m)
chatty.cabal view
@@ -10,7 +10,7 @@ -- PVP summary: +-+------- breaking API changes -- | | +----- non-breaking API additions -- | | | +--- code changes with no API change-version: 0.5.0.0+version: 0.5.1.0 -- A short (one-line) description of the package. synopsis: Some monad transformers and typeclasses to simplify I/O on a transformer stack.