fix: add MonadRec instance

This commit is contained in:
orion 2023-11-02 13:17:53 -05:00
parent b20c09ce83
commit f2120bec61
Signed by: orion
GPG Key ID: 6D4165AE4C928719

View File

@ -7,6 +7,7 @@ import Control.Alternative (class Alternative, class Plus)
import Control.Monad.Error.Class (class MonadError, class MonadThrow, liftEither, try)
import Control.Monad.Fork.Class (class MonadBracket, class MonadFork, class MonadKill, bracket, kill, never, uninterruptible)
import Control.Monad.Reader (class MonadAsk, ReaderT(..), ask)
import Control.Monad.Rec.Class (class MonadRec)
import Control.Monad.Trans.Class (class MonadTrans, lift)
import Control.Parallel (class Parallel, parallel, sequential)
import Data.Async.Class (class AsyncState)
@ -85,6 +86,7 @@ derive newtype instance (MonadAff m) => MonadAff (AsyncStateT w s m)
derive newtype instance (MonadThrow e m) => MonadThrow e (AsyncStateT w s m)
derive newtype instance (MonadError e m) => MonadError e (AsyncStateT w s m)
derive newtype instance (MonadFork f m) => MonadFork f (AsyncStateT w s m)
derive newtype instance (MonadRec m) => MonadRec (AsyncStateT w s m)
instance (Parallel f m) => Parallel (AsyncStateT w s f) (AsyncStateT w s m) where
parallel a = wrap $ parallel $ unwrap a
sequential a = wrap $ sequential $ unwrap a