summaryrefslogtreecommitdiff
path: root/Presence/NestingXML.hs
diff options
context:
space:
mode:
Diffstat (limited to 'Presence/NestingXML.hs')
-rw-r--r--Presence/NestingXML.hs10
1 files changed, 10 insertions, 0 deletions
diff --git a/Presence/NestingXML.hs b/Presence/NestingXML.hs
index bf12c9ae..c26e3d5c 100644
--- a/Presence/NestingXML.hs
+++ b/Presence/NestingXML.hs
@@ -79,6 +79,16 @@ awaitCloser lvl = do
79 withXML $ \xml -> do 79 withXML $ \xml -> do
80 loop 80 loop
81 81
82doUntilCloser :: Monad m
83 => Int -> (Event -> NestingXML o m ()) -> NestingXML o m ()
84doUntilCloser lvl thunk = do
85 fix $ \loop -> do
86 lvl' <- nesting
87 when (lvl' >= lvl) $ do
88 withXML $ \xml -> do
89 thunk xml
90 loop
91
82nextElement :: Monad m => NestingXML o m (Maybe Event) 92nextElement :: Monad m => NestingXML o m (Maybe Event)
83nextElement = do 93nextElement = do
84 lvl <- nesting 94 lvl <- nesting