Skip to content

Commit e16be32

Browse files
committed
Fixes for no overlapping instances
1 parent 3b6dc17 commit e16be32

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

src/Text/Parsing/Parser.purs.hs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,13 @@ type Parser s a = ParserT s Identity a
4242
runParser :: forall s a. s -> Parser s a -> Either ParseError a
4343
runParser s = runIdentity <<< runParserT s
4444

45+
instance functorParserT :: (Monad m) => Functor (ParserT s m) where
46+
(<$>) = liftA1
47+
48+
instance applicativeParserT :: (Monad m) => Applicative (ParserT s m) where
49+
pure = return
50+
(<*>) = ap
51+
4552
instance monadParserT :: (Monad m) => Monad (ParserT s m) where
4653
return a = ParserT (return a)
4754
(>>=) p f = ParserT (unParserT p >>= (unParserT <<< f))

0 commit comments

Comments
 (0)