diff options
Diffstat (limited to 'Presence/Nesting.hs')
-rw-r--r-- | Presence/Nesting.hs | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/Presence/Nesting.hs b/Presence/Nesting.hs index 850cb8c0..dd0e4113 100644 --- a/Presence/Nesting.hs +++ b/Presence/Nesting.hs | |||
@@ -52,6 +52,7 @@ trackNesting = awaitForever doit | |||
52 | yield xml | 52 | yield xml |
53 | 53 | ||
54 | 54 | ||
55 | lookupLang :: [(Name, [Content])] -> Maybe S.Text | ||
55 | lookupLang attrs = | 56 | lookupLang attrs = |
56 | case List.find ( (=="xml:lang") . fst) attrs of | 57 | case List.find ( (=="xml:lang") . fst) attrs of |
57 | Just (_,[ContentText x]) -> Just x | 58 | Just (_,[ContentText x]) -> Just x |
@@ -67,6 +68,9 @@ awaitCloser lvl = do | |||
67 | xml <- await | 68 | xml <- await |
68 | maybe (return ()) (const loop) xml | 69 | maybe (return ()) (const loop) xml |
69 | 70 | ||
71 | withXML :: | ||
72 | Monad m => | ||
73 | (i -> ConduitM i o m ()) -> ConduitM i o m () | ||
70 | withXML f = await >>= maybe (return ()) f | 74 | withXML f = await >>= maybe (return ()) f |
71 | 75 | ||
72 | nextElement :: Monad m => NestingXML o m (Maybe Event) | 76 | nextElement :: Monad m => NestingXML o m (Maybe Event) |