Skip to content

Commit ee0e8ea

Browse files
committed
Update classes for 0.5.0
1 parent 84b1c2f commit ee0e8ea

File tree

1 file changed

+9
-6
lines changed

1 file changed

+9
-6
lines changed

src/Text/Parsing/Parser.purs.hs

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -45,18 +45,21 @@ runParser s = runIdentity <<< runParserT s
4545
instance functorParserT :: (Monad m) => Functor (ParserT s m) where
4646
(<$>) = liftA1
4747

48+
instance applyParserT :: (Monad m) => Apply (ParserT s m) where
49+
(<*>) = ap
50+
4851
instance applicativeParserT :: (Monad m) => Applicative (ParserT s m) where
4952
pure = return
50-
(<*>) = ap
51-
52-
instance monadParserT :: (Monad m) => Monad (ParserT s m) where
53-
return a = ParserT (return a)
54-
(>>=) p f = ParserT (unParserT p >>= (unParserT <<< f))
55-
53+
5654
instance alternativeParserT :: (Monad m) => Alternative (ParserT s m) where
5755
empty = ParserT empty
5856
(<|>) p1 p2 = ParserT (unParserT p1 <|> unParserT p2)
5957

58+
instance bindParserT :: (Monad m) => Bind (ParserT s m) where
59+
(>>=) p f = ParserT (unParserT p >>= (unParserT <<< f))
60+
61+
instance monadParserT :: (Monad m) => Monad (ParserT s m)
62+
6063
instance monadTransParserT :: MonadTrans (ParserT s) where
6164
lift m = ParserT (lift (lift (lift m)))
6265

0 commit comments

Comments
 (0)