Minimal Purely Applicative Parser
问题 I'm trying to figure out how to build a "purely applicative parser" based on a simple parser implementation. The parser would not use monads in its implementation. I asked this question previously but mis-framed it so I'm trying again. Here is the basic type and its Functor , Applicative and Alternative implementations: newtype Parser a = Parser { parse :: String -> [(a,String)] } instance Functor Parser where fmap f (Parser cs) = Parser (\s -> [(f a, b) | (a, b) <- cs s]) instance