Skip to content

Missing MonadIO (Kleisli m a) instance

Should there be an

instance MonadIO m => MonadIO (Kleisli m a) where
 liftIO :: IO b -> Kleisli m a b
 liftIO io = Kleisli \_ -> liftIO io

this would allow

  • data GHCi.UI.Monad.GHCi to derive MonadIO via Kleisli Ghc (IORef GHCiSTate)
  • newtype Text.ParserCombinators.ReadPrec.ReadPrec to derive MonadIO via Kleisli ReadP Prec

See #17994.

Edited by Icelandjack
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information