diff options
author | Sylvain Henry <sylvain@haskus.fr> | 2021-05-12 17:10:06 +0200 |
---|---|---|
committer | Marge Bot <ben+marge-bot@smart-cactus.org> | 2021-05-13 16:45:03 -0400 |
commit | fc9546caf3e16db070bfc7bb5523c38595233e26 (patch) | |
tree | bbc32b230327d1ac507972e96dd28ecd6dd72497 | |
parent | c6de580547728ddfc20a3a0914bc767a282c24ec (diff) | |
download | haskell-fc9546caf3e16db070bfc7bb5523c38595233e26.tar.gz |
genprimopcode: fix bootstrap errors
* Fix for unqualified Data.List import
* Fix monad instance
-rw-r--r-- | utils/genprimopcode/ParserM.hs | 5 | ||||
-rw-r--r-- | utils/genprimopcode/Syntax.hs | 2 |
2 files changed, 3 insertions, 4 deletions
diff --git a/utils/genprimopcode/ParserM.hs b/utils/genprimopcode/ParserM.hs index 6086f6795a..63804d7654 100644 --- a/utils/genprimopcode/ParserM.hs +++ b/utils/genprimopcode/ParserM.hs @@ -33,8 +33,8 @@ instance Functor ParserM where fmap = liftM instance Applicative ParserM where - pure = return - (<*>) = ap + pure a = ParserM $ \i s -> Right (i, s, a) + (<*>) = ap instance Monad ParserM where ParserM m >>= k = ParserM $ \i s -> case m i s of @@ -43,7 +43,6 @@ instance Monad ParserM where ParserM y -> y i' s' Left err -> Left err - return a = ParserM $ \i s -> Right (i, s, a) instance MonadFail ParserM where fail err = ParserM $ \_ _ -> Left err diff --git a/utils/genprimopcode/Syntax.hs b/utils/genprimopcode/Syntax.hs index 3f1f3ef7dc..e215a89478 100644 --- a/utils/genprimopcode/Syntax.hs +++ b/utils/genprimopcode/Syntax.hs @@ -1,6 +1,6 @@ module Syntax where -import Data.List +import Data.List (nub) ------------------------------------------------------------------ -- Abstract syntax ----------------------------------------------- |