@@ -69,7 +69,7 @@ module Streamly.Internal.Data.Zipper
6969where
7070
7171import Control.Exception (assert, Exception(..))
72−import Control.Monad.Catch (MonadCatch, try, SomeException)
72+import Control.Monad.Catch (MonadCatch, try)
7373-- import GHC.Types (SPEC(..))
7474import Prelude hiding (splitAt)
7575
@@ -90,8 +90,8 @@ import qualified Streamly.Internal.Data.Stream.StreamK as K
9090--
9191-- @checkpoints@ is a stack of checkpoints. A new checkpoint is created by a
9292-- @checkpoint@ operation. A checkpoint consists of a count that tracks how
93−-- many elements we have yielded after the checkpoint was taken. We need this
94−-- information to backtrack to the checkpoint. If we enter a nested
93+-- many elements we have yielded after the checkpoint was created. We need
94+-- this information to backtrack to the checkpoint. If we enter a nested
9595-- alternative we add another checkpoint in the stack. When we exit an
9696-- alternative we call a @release@ on the checkpoint. The @release@ removes the
9797-- checkpoint from the stack and adds its element count to the previous
@@ -140,6 +140,8 @@ checkpoint :: Zipper m a -> Zipper m a
140140checkpoint (Zipper cps xs ys stream) = Zipper (0:cps) xs ys stream
141141
142142-- | Release the latest checkpoint, releases any values held by the checkpoint.
143+-- Note that the values may still be held by other checkpoints in the stack of
144+-- checkpoints.
143145--
144146-- /Internal/
145147--
@@ -211,7 +213,7 @@ parse pstep initial extract (Zipper [] ls rs stream) =
211213 pst <- acc
212214 r <- try $ extract pst
213215 return $ case r of
214− Left (e :: SomeException) ->
216+ Left (e :: PR.ParseError) ->
215217 (nil, Left (displayException e))
216218 Right b -> (nil, Right b)
217219 single x = do
@@ -294,7 +296,7 @@ parse pstep initial extract (Zipper (cp:cps) ls rs stream) =
294296 pst <- acc
295297 r <- try $ extract pst
296298 return $ case r of
297− Left (e :: SomeException) ->
299+ Left (e :: PR.ParseError) ->
298300 (nil, Left (displayException e))
299301 Right b -> (nil, Right b)
300302 single x = do