File tree Expand file tree Collapse file tree 1 file changed +6
-0
lines changed Expand file tree Collapse file tree 1 file changed +6
-0
lines changed Original file line number Diff line number Diff line change @@ -4,6 +4,7 @@ import Prelude
4
4
5
5
import Data.Maybe
6
6
import Data.Array
7
+ import Data.Tuple
7
8
import Data.Either
8
9
9
10
import Control.Monad
@@ -18,6 +19,11 @@ import Text.Parsing.Parser
18
19
fix :: forall m s a . (ParserT m s a -> ParserT m s a ) -> ParserT m s a
19
20
fix f = ParserT (StateT (\ s -> runStateT (unParserT (f (fix f))) s))
20
21
22
+ fix2 :: forall m s a b . (Tuple (ParserT m s a ) (ParserT m s b ) -> Tuple (ParserT m s a ) (ParserT m s b )) -> Tuple (ParserT m s a ) (ParserT m s b )
23
+ fix2 f = Tuple
24
+ (ParserT (StateT (\ s -> runStateT (unParserT (fst (f (fix2 f)))) s)))
25
+ (ParserT (StateT (\ s -> runStateT (unParserT (snd (f (fix2 f)))) s)))
26
+
21
27
many :: forall m s a . (Monad m ) => ParserT s m a -> ParserT s m [a ]
22
28
many p = many1 p <|> return []
23
29
You can’t perform that action at this time.
0 commit comments