mirror of
https://github.com/github/semantic.git
synced 2024-11-28 10:15:55 +03:00
Define a RightModule instance.
This commit is contained in:
parent
497e0dd226
commit
f72070d378
@ -17,6 +17,7 @@ module Data.Scope
|
||||
import Control.Applicative (liftA2)
|
||||
import Control.Effect.Carrier
|
||||
import Control.Monad ((>=>), guard)
|
||||
import Control.Monad.Module
|
||||
import Control.Monad.Trans.Class
|
||||
import Data.Function (on)
|
||||
|
||||
@ -69,6 +70,9 @@ instance Monad f => Monad (Scope a f) where
|
||||
instance MonadTrans (Scope a) where
|
||||
lift = Scope . pure . S
|
||||
|
||||
instance RightModule (Scope a) where
|
||||
Scope m >>=* f = Scope (fmap (>>= f) <$> m)
|
||||
|
||||
|
||||
foldScope :: (forall a . Incr z (n a) -> m (Incr z (n a)))
|
||||
-> (forall x y . (x -> m y) -> f x -> n y)
|
||||
|
Loading…
Reference in New Issue
Block a user