
21 Sep
2008
21 Sep
'08
9:55 a.m.
Hello Rafal, Sunday, September 21, 2008, 5:43:14 PM, you wrote:
withImageSurfaceFromPNG file $ \png -> do w <- renderWith png $ imageSurfaceGetWidth png h <- renderWith png $ imageSurfaceGetHeight png
this is very idiomatic Haskell, consider it as a sort of RAII. you may even omit additional tab here:
withImageSurfaceFromPNG file $ \png -> do w <- renderWith png $ imageSurfaceGetWidth png h <- renderWith png $ imageSurfaceGetHeight png ...
afair, Render is a super-IO monad so you can just lift any IO operation to Render: x <- liftIO$ imageSurfaceCreateFromPNG file -- Best regards, Bulat mailto:Bulat.Ziganshin@gmail.com