
3 Apr
2020
3 Apr
'20
12:21 a.m.
On Thu, 2 Apr 2020, cyberfined via Haskell-Cafe wrote:
writeImage :: FilePath -> Image -> IO () writeImage path img = bracket (openFile path WriteMode) (hClose) $ \hdl -> B.hPut hdl header >> B.hPut hdl body
Btw. the bracket thing is equivalent to withFile path WriteMode