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
45
45
instance functorParserT :: (Monad m ) => Functor (ParserT s m ) where
46
46
(<$>) = liftA1
47
47
48
+ instance applyParserT :: (Monad m ) => Apply (ParserT s m ) where
49
+ (<*>) = ap
50
+
48
51
instance applicativeParserT :: (Monad m ) => Applicative (ParserT s m ) where
49
52
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
+
56
54
instance alternativeParserT :: (Monad m ) => Alternative (ParserT s m ) where
57
55
empty = ParserT empty
58
56
(<|>) p1 p2 = ParserT (unParserT p1 <|> unParserT p2)
59
57
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
+
60
63
instance monadTransParserT :: MonadTrans (ParserT s ) where
61
64
lift m = ParserT (lift (lift (lift m)))
62
65
You can’t perform that action at this time.
0 commit comments