            yield len
            return rest

    let warc :: Warc IO ()
        warc = parseWarc (PBS.fromHandle stdin)

    runEffect $ do
        rest <- produceRecords docLength warc >-> PP.mapM_ (liftIO . print)
        -- print the leftovers
        rest >-> PBS.toHandle stdout