Solution

ID: past-exam-of-the-year-1-of-the-computer-science-course-of-the-university-of-oxford/2016/functional-programming-design-and-analysis-of-algorithms-resit/3/d/solution

The parser recognizes exactly one leading operator character:
parseOp :: Parse Char
parseOp (c:cs)
  | c `elem` "+-*/" = Just (c,cs)
parseOp _ = Nothing
An empty input fails, and any later characters remain for the next parser. The last example printed in this part uses the name parseInt; its failure result does not change the requested operator parser.

New to topics? Read the docs here!