summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--utils/genprimopcode/ParserM.hs5
-rw-r--r--utils/genprimopcode/Syntax.hs2
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 -----------------------------------------------