On Sat, 2008-06-28 at 12:14 +0200, Axel Simon wrote: > On Jun 28, 2008, at 2:11, Marco Túlio Gontijo e Silva wrote: > > > Hello. > > > > The documentation from pixbufNewFromFile :: FilePath -> IO Pixbuf > > gives: > > > > If an error occurs, the function will return Left (err,msg) where > > err is > > the error code and msg is a human readable description of the > > error. If > > an error occurs which is not captured by any of those in > > PixbufError, an > > exception is thrown. > > > > Is this right? Can Pixbuf be Left? > > No, this must be left-over from a previous implementation of the > function. It does obviously always return a Pixbuf. If there is an > error, the function will throw an exception that can be caught with > handleGError in glib/System/Glib/GError.chs.pp .
Right. The rationale for the change was that ordinary file functions like 'readFile' do not return Maybe but instead use IO exceptions. So we changed 'pixbufNewFromFile' to do the same but as you noticed we forgot to update the documentation. Duncan ------------------------------------------------------------------------- Check out the new SourceForge.net Marketplace. It's the best place to buy or sell services for just about anything Open Source. http://sourceforge.net/services/buy/index.php _______________________________________________ Gtk2hs-devel mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/gtk2hs-devel
