diff options
| author | Arianna Masciolini <uzkamascio@gmail.com> | 2025-08-02 23:01:53 +0200 |
|---|---|---|
| committer | Arianna Masciolini <uzkamascio@gmail.com> | 2025-08-02 23:01:53 +0200 |
| commit | 8f4e8c73d2d17ad49a6b72a93090a7a39e5d84f0 (patch) | |
| tree | 478b68d1e493349f9e74b5c61862830012f2f2f3 /src/compiler/GF/Infra | |
| parent | c2431e06b2fcd53e71f06d54b1b74b102aed7590 (diff) | |
| parent | d983255326d232a9d0e1541e5b48743e6ce35e59 (diff) | |
Merge branch 'master' of https://github.com/GrammaticalFramework/gf-core into release-3.12
Diffstat (limited to 'src/compiler/GF/Infra')
| -rw-r--r-- | src/compiler/GF/Infra/CheckM.hs | 4 | ||||
| -rw-r--r-- | src/compiler/GF/Infra/SIO.hs | 4 |
2 files changed, 4 insertions, 4 deletions
diff --git a/src/compiler/GF/Infra/CheckM.hs b/src/compiler/GF/Infra/CheckM.hs index a5ff7148a..1dd26dd5c 100644 --- a/src/compiler/GF/Infra/CheckM.hs +++ b/src/compiler/GF/Infra/CheckM.hs @@ -48,7 +48,7 @@ newtype Check a instance Functor Check where fmap = liftM instance Monad Check where - return x = Check $ \{-ctxt-} ws -> (ws,Success x) + return = pure f >>= g = Check $ \{-ctxt-} ws -> case unCheck f {-ctxt-} ws of (ws,Success x) -> unCheck (g x) {-ctxt-} ws @@ -58,7 +58,7 @@ instance Fail.MonadFail Check where fail = raise instance Applicative Check where - pure = return + pure x = Check $ \{-ctxt-} ws -> (ws,Success x) (<*>) = ap instance ErrorMonad Check where diff --git a/src/compiler/GF/Infra/SIO.hs b/src/compiler/GF/Infra/SIO.hs index 906f39345..7b5a7dac6 100644 --- a/src/compiler/GF/Infra/SIO.hs +++ b/src/compiler/GF/Infra/SIO.hs @@ -52,11 +52,11 @@ newtype SIO a = SIO {unS::PutStr->IO a} instance Functor SIO where fmap = liftM instance Applicative SIO where - pure = return + pure x = SIO (const (pure x)) (<*>) = ap instance Monad SIO where - return x = SIO (const (return x)) + return = pure SIO m1 >>= xm2 = SIO $ \ h -> m1 h >>= \ x -> unS (xm2 x) h instance Fail.MonadFail SIO where |
