File tree Expand file tree Collapse file tree 1 file changed +9
-6
lines changed Expand file tree Collapse file tree 1 file changed +9
-6
lines changed Original file line number Diff line number Diff line change @@ -45,18 +45,21 @@ runParser s = runIdentity <<< runParserT s
4545instance functorParserT :: (Monad m ) => Functor (ParserT s m ) where
4646 (<$>) = liftA1
4747
48+ instance applyParserT :: (Monad m ) => Apply (ParserT s m ) where
49+ (<*>) = ap
50+
4851instance 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+
5654instance 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+
6063instance monadTransParserT :: MonadTrans (ParserT s ) where
6164 lift m = ParserT (lift (lift (lift m)))
6265
You can’t perform that action at this time.
0 commit comments