X-Git-Url: https://gerrit.simantics.org/r/gitweb?p=simantics%2Fplatform.git;a=blobdiff_plain;f=bundles%2Forg.simantics.scl.runtime%2Fscl%2FPrelude.scl;h=f983251093272d2168cb9eacc05db4542660afa0;hp=e92603becb8e4300db875532c2b87ba090b742e8;hb=bd78deb4759a49ed84200b95fddc9569438512f7;hpb=098f08657684792709db2cf231bb63956651255e diff --git a/bundles/org.simantics.scl.runtime/scl/Prelude.scl b/bundles/org.simantics.scl.runtime/scl/Prelude.scl index e92603bec..f98325109 100644 --- a/bundles/org.simantics.scl.runtime/scl/Prelude.scl +++ b/bundles/org.simantics.scl.runtime/scl/Prelude.scl @@ -1096,6 +1096,7 @@ class (FunctorE f) => FunctorM f where /// MonadE /// class (FunctorE m, Monad m) => MonadE m where + "An effectful version of the bind operator `(>>=)`" bindE :: m a -> (a -> m b) -> m b instance MonadE Maybe where @@ -1109,6 +1110,11 @@ instance MonadE (Either a) where instance MonadE [] where bindE l f = concatMap f l +@inline +"An effectful version of the Kleisli composition operator `(>=>)`" +compE :: MonadE m => (a -> m b) -> (b -> m c) -> a -> m c +compE f g x = (f x) `bindE` g + /// MZeroE /// class (MonadE m, MonadZero m) => MonadZeroE m where