旧pipes
教程有以下示例。这段代码在 4.1.1 版中会是什么样子?
read' :: FilePath -> Frame Text IO C C ()
read' file = do
liftU $ putStrLn "Opening file..."
h <- liftU $ openFile file ReadMode
-- The following requires "import qualified Control.Monad as M"
finallyD (putStrLn "Closing file ..." M.>> hClose h) $ readFile' h