diff options
Diffstat (limited to 'dht/Presence/Nesting.hs')
-rw-r--r-- | dht/Presence/Nesting.hs | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/dht/Presence/Nesting.hs b/dht/Presence/Nesting.hs index 403d63cf..a9e550d4 100644 --- a/dht/Presence/Nesting.hs +++ b/dht/Presence/Nesting.hs | |||
@@ -24,12 +24,10 @@ doNestingXML :: Monad m => NestingXML o m r -> ConduitM Event o m r | |||
24 | doNestingXML m = | 24 | doNestingXML m = |
25 | evalStateC (XMLState 0 StrictNil) (trackNesting .| m) | 25 | evalStateC (XMLState 0 StrictNil) (trackNesting .| m) |
26 | 26 | ||
27 | startNestingXML :: Monad m => NestingXML o m r -> ConduitM Event o m (r, XMLState) | 27 | startNestingXML :: Monad m => NestingXML o m r -> ConduitM Event o m (r, NestingXML o m ()) |
28 | startNestingXML m = | 28 | startNestingXML m = do |
29 | runStateC (XMLState 0 StrictNil) (trackNesting .| m) | 29 | (r,st) <- runStateC (XMLState 0 StrictNil) (trackNesting .| m) |
30 | 30 | return (r, lift $ put st) | |
31 | finishNestingXML :: Monad m => XMLState -> NestingXML o m r -> ConduitM Event o m r | ||
32 | finishNestingXML = evalStateC | ||
33 | 31 | ||
34 | nesting :: Monad m => NestingXML o m Int | 32 | nesting :: Monad m => NestingXML o m Int |
35 | nesting = lift $ (return . nestingLevel) =<< get | 33 | nesting = lift $ (return . nestingLevel) =<< get |