summaryrefslogtreecommitdiff
path: root/TraversableT.hs
diff options
context:
space:
mode:
authorjoe <joe@jerkface.net>2014-03-05 20:51:25 -0500
committerjoe <joe@jerkface.net>2014-03-05 20:51:25 -0500
commite2515cf8d4fe6e775fcec5863f87acca5295e92c (patch)
tree1db88e1287464202cd4cf0d423a14dde602ce99a /TraversableT.hs
parenta9934d3ccc5ab92b345eda277472d88e7f7edad7 (diff)
untested: inform clients about remote presences
Diffstat (limited to 'TraversableT.hs')
-rw-r--r--TraversableT.hs6
1 files changed, 6 insertions, 0 deletions
diff --git a/TraversableT.hs b/TraversableT.hs
index cd04731c..98a97bf6 100644
--- a/TraversableT.hs
+++ b/TraversableT.hs
@@ -5,6 +5,7 @@ import Control.Monad (join,MonadPlus(..))
5import Control.Monad.Trans.Class 5import Control.Monad.Trans.Class
6import Control.Applicative 6import Control.Applicative
7import Data.Foldable (Foldable(foldMap)) 7import Data.Foldable (Foldable(foldMap))
8import Data.Maybe (maybeToList)
8 9
9-- | 10-- |
10-- 11--
@@ -75,4 +76,9 @@ liftCatch :: (m (t a) -> (e -> m (t a)) -> m (t a)) ->
75liftCatch catchError m h = TraversableT $ runTraversableT m 76liftCatch catchError m h = TraversableT $ runTraversableT m
76 `catchError` \e -> runTraversableT (h e) 77 `catchError` \e -> runTraversableT (h e)
77 78
79liftMaybe :: Monad m => Maybe a -> TraversableT [] m a
80liftMaybe = liftT . maybeToList
81
82liftIOMaybe :: IO (Maybe a) -> TraversableT [] IO a
83liftIOMaybe = liftMT . fmap maybeToList
78 84