pipes-safe-2.1.0: Safety for the pipes ecosystem

Safe HaskellSafe-Inferred

Pipes.Safe.Prelude

Contents

Description

Simple resource management functions

Synopsis

Handle management

withFile :: MonadSafe m => FilePath -> IOMode -> (Handle -> m r) -> m rSource

Acquire a Handle within MonadSafe

String I/O

Note that Strings are very inefficient, and I will release future separate packages with ByteString and Text operations. I only provide these to allow users to test simple I/O without requiring any additional library dependencies.

readFile :: MonadSafe m => FilePath -> Producer' String m ()Source

Read lines from a file, automatically opening and closing the file as necessary

writeFile :: MonadSafe m => FilePath -> Consumer' String m rSource

Write lines to a file, automatically opening and closing the file as necessary