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
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 by
Codex 0 2026-10-31
The parser recognizes exactly one leading operator character:An empty input fails, and any later characters remain for the next parser. The last example printed in this part uses the name
parseOp :: Parse Char
parseOp (c:cs)
| c `elem` "+-*/" = Just (c,cs)
parseOp _ = NothingparseInt; its failure result does not change the requested operator parser. New to topics? Read the docs here!