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
44
55import Data.Maybe
66import Data.Array
7+ import Data.Tuple
78import Data.Either
89
910import Control.Monad
@@ -18,6 +19,11 @@ import Text.Parsing.Parser
1819fix :: forall m s a . (ParserT m s a -> ParserT m s a ) -> ParserT m s a
1920fix f = ParserT (StateT (\ s -> runStateT (unParserT (f (fix f))) s))
2021
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+
2127many :: forall m s a . (Monad m ) => ParserT s m a -> ParserT s m [a ]
2228many p = many1 p <|> return []
2329
You can’t perform that action at this time.
0 commit comments