generated from tpl/purs
fix: par
This commit is contained in:
parent
df273eb635
commit
2a4ee6482d
@ -10,6 +10,7 @@ package:
|
|||||||
- mmorph
|
- mmorph
|
||||||
- newtype
|
- newtype
|
||||||
- node-buffer
|
- node-buffer
|
||||||
|
- parallel
|
||||||
- prelude
|
- prelude
|
||||||
- simple-json
|
- simple-json
|
||||||
- tailrec
|
- tailrec
|
||||||
|
@ -8,8 +8,10 @@ import Control.Monad.Morph (class MFunctor, class MMonad, embed, hoist)
|
|||||||
import Control.Monad.Reader (class MonadAsk, class MonadReader, ReaderT(..), ask, runReaderT)
|
import Control.Monad.Reader (class MonadAsk, class MonadReader, ReaderT(..), ask, runReaderT)
|
||||||
import Control.Monad.Rec.Class (class MonadRec)
|
import Control.Monad.Rec.Class (class MonadRec)
|
||||||
import Control.Monad.Trans.Class (class MonadTrans, lift)
|
import Control.Monad.Trans.Class (class MonadTrans, lift)
|
||||||
|
import Control.Parallel (class Parallel, parallel, sequential)
|
||||||
import Data.Bifunctor (lmap)
|
import Data.Bifunctor (lmap)
|
||||||
import Data.Either (Either)
|
import Data.Either (Either)
|
||||||
|
import Data.Functor.Compose (Compose(..))
|
||||||
import Data.Newtype (class Newtype, unwrap, wrap)
|
import Data.Newtype (class Newtype, unwrap, wrap)
|
||||||
import Effect.Aff.Class (class MonadAff)
|
import Effect.Aff.Class (class MonadAff)
|
||||||
import Effect.Class (class MonadEffect)
|
import Effect.Class (class MonadEffect)
|
||||||
@ -17,6 +19,14 @@ import Effect.Exception as Effect.Exception
|
|||||||
import Gitea.Config (Config)
|
import Gitea.Config (Config)
|
||||||
import Gitea.Error as Gitea.Error
|
import Gitea.Error as Gitea.Error
|
||||||
|
|
||||||
|
newtype GiteaParT :: (Type -> Type) -> Type -> Type
|
||||||
|
newtype GiteaParT m a = GiteaParT (ReaderT Config (Compose m (Either Gitea.Error.Error)) a)
|
||||||
|
|
||||||
|
derive instance Newtype (GiteaParT m a) _
|
||||||
|
derive newtype instance Functor m => Functor (GiteaParT m)
|
||||||
|
derive newtype instance Apply m => Apply (GiteaParT m)
|
||||||
|
derive newtype instance Applicative m => Applicative (GiteaParT m)
|
||||||
|
|
||||||
newtype GiteaT :: (Type -> Type) -> Type -> Type
|
newtype GiteaT :: (Type -> Type) -> Type -> Type
|
||||||
newtype GiteaT m a = GiteaT (ReaderT Config (ExceptT Gitea.Error.Error m) a)
|
newtype GiteaT m a = GiteaT (ReaderT Config (ExceptT Gitea.Error.Error m) a)
|
||||||
|
|
||||||
@ -42,6 +52,9 @@ derive newtype instance MonadAff m => MonadAff (GiteaT m)
|
|||||||
derive newtype instance Monad m => MonadError Gitea.Error.Error (GiteaT m)
|
derive newtype instance Monad m => MonadError Gitea.Error.Error (GiteaT m)
|
||||||
derive newtype instance Monad m => MonadThrow Gitea.Error.Error (GiteaT m)
|
derive newtype instance Monad m => MonadThrow Gitea.Error.Error (GiteaT m)
|
||||||
derive newtype instance MonadRec m => MonadRec (GiteaT m)
|
derive newtype instance MonadRec m => MonadRec (GiteaT m)
|
||||||
|
instance (Parallel f m, Monad m) => Parallel (GiteaParT f) (GiteaT m) where
|
||||||
|
parallel m = wrap $ parallel $ unwrap m
|
||||||
|
sequential f = wrap $ sequential $ unwrap f
|
||||||
|
|
||||||
derive newtype instance Monad m => Functor (GiteaT m)
|
derive newtype instance Monad m => Functor (GiteaT m)
|
||||||
derive newtype instance Monad m => Apply (GiteaT m)
|
derive newtype instance Monad m => Apply (GiteaT m)
|
||||||
|
Loading…
Reference in New Issue
Block a user