@@ -35,6 +35,7 @@ module Streamly.Benchmark.FileIO.Stream
3535 , wordsUnwordsCopy
3636 , copyCodecChar8
3737 , copyCodecUtf8
38+ , copyCodecUtf8Lenient
3839 , chunksOf
3940 , chunksOfD
4041 , splitOn
@@ -217,6 +218,22 @@ inspect $ hasNoTypeClasses 'copyCodecUtf8
217218-- inspect $ 'copyCodecUtf8 `hasNoType` ''D.ConcatMapUState
218219#endif
219220
221+-- | Copy file
222+{-# INLINE copyCodecUtf8Lenient #-}
223+copyCodecUtf8Lenient :: Handle -> Handle -> IO ()
224+copyCodecUtf8Lenient inh outh =
225+ S.runFold (FH.write outh)
226+ $ SS.encodeUtf8
227+ $ SS.decodeUtf8Lenient
228+ $ FH.read inh
229+
230+#ifdef INSPECTION
231+inspect $ hasNoTypeClasses 'copyCodecUtf8Lenient
232+-- inspect $ 'copyCodecUtf8Lenient `hasNoType` ''Step
233+-- inspect $ 'copyCodecUtf8Lenient `hasNoType` ''AT.FlattenState
234+-- inspect $ 'copyCodecUtf8Lenient `hasNoType` ''D.ConcatMapUState
235+#endif
236+
220237-- | Slice in chunks of size n and get the count of chunks.
221238{-# INLINE chunksOf #-}
222239chunksOf :: Int -> Handle -> IO Int