
I'm trying to attach a handler to a Gtk2Hs event, and get the error: No instance for (Control.Monad.IO.Class.MonadIO (mtl-1.1.0.2:Control.Monad.Reader.ReaderT (GHC.Ptr.Ptr EAny) IO)) arising from a use of `liftIO' Possible fix: add an instance declaration for (Control.Monad.IO.Class.MonadIO (mtl-1.1.0.2:Control.Monad.Reader.ReaderT (GHC.Ptr.Ptr EAny) IO)) This occurs with the sample at http://www.haskell.org/haskellwiki/Gtk2Hs/Tutorials/Intro import Graphics.UI.Gtk import Control.Monad.Trans(liftIO) main = do initGUI window <- windowNew window `on` deleteEvent $ liftIO mainQuit >> return False -- i.e., on window deleteEvent (liftIO mainQuit >> return False) widgetShow window mainGUI Why can't GHC find the instance MonadIO m => MonadIO (ReaderT r m)?