我正在使用 ReaderT 为这种类型编写 Monad 实例并通过
newtype HIO a = HIO {runHIO :: Set HiPermission -> IO a}
我试过这样做
newtype HIO a = HIO {runHIO :: Set HiPermission -> IO a}
deriving (Functor, Applicative, Monad) via (ReaderT (Set HiPermission) IO)
但出现错误:
Couldn't match representation of type `Set HiPermission -> IO c' with that of `ReaderT (Set HiPermission) IO c'
arising from the coercion of the method
我究竟做错了什么?