feat: unliftaff

This commit is contained in:
orion 2023-11-22 09:01:47 -06:00
parent f58fa86d93
commit 4f7e9399f3
Signed by: orion
GPG Key ID: 6D4165AE4C928719
2 changed files with 6 additions and 0 deletions

View File

@ -3,6 +3,7 @@ package:
- aff
- arrays
- avar
- unlift
name: sync
test:
main: Test.Main

View File

@ -9,6 +9,7 @@ import Control.Monad.Fork.Class (class MonadBracket, class MonadFork, class Mona
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.Monad.Unlift (class MonadUnlift)
import Control.Parallel (class Parallel, parallel, sequential)
import Data.Async.Class (class AsyncState)
import Data.Async.Class as State
@ -20,7 +21,9 @@ import Data.Traversable (for, for_)
import Data.Tuple (fst, snd)
import Data.Tuple.Nested (type (/\), (/\))
import Effect.Aff.Class (class MonadAff)
import Effect.Aff.Unlift (class MonadUnliftAff)
import Effect.Class (class MonadEffect)
import Effect.Unlift (class MonadUnliftEffect)
-- | Computations with a mutable value of type `s` that may be evaluated in parallel
-- |
@ -172,6 +175,8 @@ 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)
derive newtype instance (MonadUnliftAff m) => MonadUnliftAff (AsyncStateT w s m)
derive newtype instance (MonadUnliftEffect m) => MonadUnliftEffect (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