diff options
| author | Inari Listenmaa <inari.listenmaa@gmail.com> | 2025-08-02 18:59:07 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2025-08-02 18:59:07 +0200 |
| commit | 65e85c5a3cba4df82547a018b4135ac63551d8df (patch) | |
| tree | 33a842b24b9e3851c6b6cf095f11f562b0fd6b7f /src/compiler/GF/Data/BacktrackM.hs | |
| parent | 981d6b9bddacee6a204ac48f2a4e27f4cca1bd47 (diff) | |
| parent | 01c4f82e077b93cb2318830c56070c0ec15a20e6 (diff) | |
Merge pull request #175 from inariksit/new-ghc
Changes to make it work with newer stack/GHC:
- unix library changed API in 2.8
- Monad of no return & Semigroup as a superclass of Monoid
- import Control.Monad (join, when, (<=<))
- fixed CI issues
Diffstat (limited to 'src/compiler/GF/Data/BacktrackM.hs')
| -rw-r--r-- | src/compiler/GF/Data/BacktrackM.hs | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/compiler/GF/Data/BacktrackM.hs b/src/compiler/GF/Data/BacktrackM.hs index 970de5c06..69bc2c29b 100644 --- a/src/compiler/GF/Data/BacktrackM.hs +++ b/src/compiler/GF/Data/BacktrackM.hs @@ -64,11 +64,11 @@ finalStates :: BacktrackM s () -> s -> [s] finalStates bm = map fst . runBM bm instance Applicative (BacktrackM s) where - pure = return + pure a = BM (\c s b -> c a s b) (<*>) = ap instance Monad (BacktrackM s) where - return a = BM (\c s b -> c a s b) + return = pure BM m >>= k = BM (\c s b -> m (\a s b -> unBM (k a) c s b) s b) where unBM (BM m) = m |
