benchmark :: FilePath -> Benchmark
benchmark fp = bgroup "ReadLines"
    [ bench "Text"       $ withHandle $ foldLinesT (\n _ -> n + 1) (0 :: Int)
    ]
  where
    withHandle f = whnfIO $ do
        h <- openFile fp ReadMode
        hSetBuffering h (BlockBuffering (Just 16384))
        x <- f h
        hClose h
        return x

-- | Text line fold
--
benchmark :: FilePath -> Benchmark
benchmark fp = bgroup "ReadLines"
    [ bench "Text"       $ withHandle $ foldLinesT (\n _ -> n + 1) (0 :: Int)
    ]
  where
    withHandle f = whnfIO $ do
        h <- openFile fp ReadMode
        hSetBuffering h (BlockBuffering (Just 16384))
        x <- f h
        hClose h
        return x

-- | Text line fold
--
benchmark fp = bgroup "ReadLines"
    [ bench "Text"       $ withHandle $ foldLinesT (\n _ -> n + 1) (0 :: Int)
    ]
  where
    withHandle f = whnfIO $ do
        h <- openFile fp ReadMode
        hSetBuffering h (BlockBuffering (Just 16384))
        x <- f h
        hClose h
        return x

-- | Text line fold
--