diff options
Diffstat (limited to 'Presence/Nesting.hs')
-rw-r--r-- | Presence/Nesting.hs | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/Presence/Nesting.hs b/Presence/Nesting.hs index 24f9baad..850cb8c0 100644 --- a/Presence/Nesting.hs +++ b/Presence/Nesting.hs | |||
@@ -27,6 +27,12 @@ doNestingXML m = | |||
27 | nesting :: Monad m => NestingXML o m Int | 27 | nesting :: Monad m => NestingXML o m Int |
28 | nesting = lift $ (return . nestingLevel) =<< get | 28 | nesting = lift $ (return . nestingLevel) =<< get |
29 | 29 | ||
30 | xmlLang :: Monad m => NestingXML o m (Maybe Lang) | ||
31 | xmlLang = fmap (fmap snd . top . langStack) (lift get) | ||
32 | where | ||
33 | top ( a :! as ) = Just a | ||
34 | top _ = Nothing | ||
35 | |||
30 | 36 | ||
31 | trackNesting :: Monad m => ConduitM Event Event (StateT XMLState m) () | 37 | trackNesting :: Monad m => ConduitM Event Event (StateT XMLState m) () |
32 | trackNesting = awaitForever doit | 38 | trackNesting = awaitForever doit |
@@ -77,3 +83,4 @@ nextElement = do | |||
77 | if (lvl'>=lvl) then loop | 83 | if (lvl'>=lvl) then loop |
78 | else return Nothing | 84 | else return Nothing |
79 | 85 | ||
86 | |||