diff options
-rw-r--r-- | TraversableT.hs | 12 | ||||
-rw-r--r-- | presence.cabal | 6 |
2 files changed, 14 insertions, 4 deletions
diff --git a/TraversableT.hs b/TraversableT.hs index 98a97bf6..cc187951 100644 --- a/TraversableT.hs +++ b/TraversableT.hs | |||
@@ -4,7 +4,7 @@ import Data.Traversable | |||
4 | import Control.Monad (join,MonadPlus(..)) | 4 | import Control.Monad (join,MonadPlus(..)) |
5 | import Control.Monad.Trans.Class | 5 | import Control.Monad.Trans.Class |
6 | import Control.Applicative | 6 | import Control.Applicative |
7 | import Data.Foldable (Foldable(foldMap)) | 7 | import Data.Foldable (Foldable(foldMap), toList) |
8 | import Data.Maybe (maybeToList) | 8 | import Data.Maybe (maybeToList) |
9 | 9 | ||
10 | -- | | 10 | -- | |
@@ -82,3 +82,13 @@ liftMaybe = liftT . maybeToList | |||
82 | liftIOMaybe :: IO (Maybe a) -> TraversableT [] IO a | 82 | liftIOMaybe :: IO (Maybe a) -> TraversableT [] IO a |
83 | liftIOMaybe = liftMT . fmap maybeToList | 83 | liftIOMaybe = liftMT . fmap maybeToList |
84 | 84 | ||
85 | handleT :: ( Monad m | ||
86 | , Traversable t ) => | ||
87 | (t a -> TraversableT t m a) | ||
88 | -> TraversableT t m a | ||
89 | -> TraversableT t m a | ||
90 | handleT catcher body = TraversableT $ do | ||
91 | tx <- runTraversableT body | ||
92 | if null (toList tx) | ||
93 | then runTraversableT $ catcher tx | ||
94 | else return tx | ||
diff --git a/presence.cabal b/presence.cabal index a54213bb..cbf857f7 100644 --- a/presence.cabal +++ b/presence.cabal | |||
@@ -16,10 +16,10 @@ data-dir: "" | |||
16 | executable presence | 16 | executable presence |
17 | build-depends: base -any, stm -any, text (>=0.11.2.0), xml-types -any, containers -any, | 17 | build-depends: base -any, stm -any, text (>=0.11.2.0), xml-types -any, containers -any, |
18 | network -any, time -any, transformers -any, resourcet -any, bytestring -any, | 18 | network -any, time -any, transformers -any, resourcet -any, bytestring -any, |
19 | mtl -any, mmorph -any, conduit (>=1.0.4), xml-conduit -any, void -any, random -any, | 19 | mtl -any, mmorph -any, conduit (>=1.0.4), void -any, random -any, |
20 | data-default -any, blaze-builder-conduit -any, blaze-builder -any, unix -any, | 20 | data-default -any, blaze-builder -any, unix -any, conduit-extra -any, |
21 | binary -any, directory -any, cpu -any, template-haskell -any, deepseq -any, | 21 | binary -any, directory -any, cpu -any, template-haskell -any, deepseq -any, |
22 | filepath -any, hinotify -any, process -any | 22 | filepath -any, hinotify -any, process -any, xml-conduit -any |
23 | main-is: xmppServer.hs | 23 | main-is: xmppServer.hs |
24 | buildable: True | 24 | buildable: True |
25 | cpp-options: -DRENDERFLUSH | 25 | cpp-options: -DRENDERFLUSH |