Monadic parser combinators
Monadic parser combinators
复制标题
Monadic 解析器组合器
DOI:
--
复制
发表时间:
1996
期刊:
影响因子:
--
通讯作者:
E. Meijer
中科院分区:
文献类型:
--
作者:
G. Hutton;E. Meijer
In functional programming, a popular approach to building recursive descent parsers is to model parsers as functions, and to define higher-order functions (or combinators) that implement grammar constructions such as sequencing, choice, and repetition. Such parsers form an instance of a monad, an algebraic structure from mathematics that has proved useful for addressing a number of computational problems. The purpose of this report is to provide a step-by-step tutorial on the monadic approach to building functional parsers, and to explain some of the benefits that result from exploiting monads. No prior knowledge of parser combinators or of monads is assumed. Indeed, this report can also be viewed as a first introduction to the use of monads in programming.