I'm writing the Monad instance for this type using ReaderT and deriving via
newtype HIO a = HIO {runHIO :: Set HiPermission -> IO a}
I've tried to do it this way
newtype HIO a = HIO {runHIO :: Set HiPermission -> IO a}
deriving (Functor, Applicative, Monad) via (ReaderT (Set HiPermission) IO)
but got error:
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
What am I doing wrong?