cschunkI :: (ChunkData t, Show d, Monad m) =>
            Iter (CtlStream t d) m (CtlStream t d)
cschunkI = chunkI >>= check
    where check (Chunk (CSData h t) eof) = Done (csData h) (Chunk t eof)
          check (Chunk (CSCtl h t) eof)  = Done (csCtl h) (Chunk t eof)
          check (Chunk CSEmpty True)     = Done CSEmpty (Chunk mempty True)
          check _                        = cschunkI

-- | Strip control requests out of an input stream of type
-- 'CtlStream', to produce a stream of ordinary data.
cschunkI :: (ChunkData t, Show d, Monad m) =>
            Iter (CtlStream t d) m (CtlStream t d)
cschunkI = chunkI >>= check
    where check (Chunk (CSData h t) eof) = Done (csData h) (Chunk t eof)
          check (Chunk (CSCtl h t) eof)  = Done (csCtl h) (Chunk t eof)
          check (Chunk CSEmpty True)     = Done CSEmpty (Chunk mempty True)
          check _                        = cschunkI

-- | Strip control requests out of an input stream of type
-- 'CtlStream', to produce a stream of ordinary data.
cschunkI = chunkI >>= check
    where check (Chunk (CSData h t) eof) = Done (csData h) (Chunk t eof)
          check (Chunk (CSCtl h t) eof)  = Done (csCtl h) (Chunk t eof)
          check (Chunk CSEmpty True)     = Done CSEmpty (Chunk mempty True)
          check _                        = cschunkI

-- | Strip control requests out of an input stream of type
-- 'CtlStream', to produce a stream of ordinary data.