1
1
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:
Rob Rix 2019-07-17 11:03:10 -04:00
parent 497e0dd226
commit f72070d378
No known key found for this signature in database
GPG Key ID: F188A01508EA1CF7

View File

@ -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)