| G. Hutton, E. Meijer, Monadic parser combinators, JFP 8 (4) (1996) 437--444. 4.2 |
....functions, and user defined datatypes. Some of these are illustrated in the following example: Prelude (not True) False False Prelude reverse Hugs is cool looc si sguH Prelude filter even [1. 10] 2, 4, 6, 8, 10] Prelude take 10 fibs where fibs = 0:1:zipWith ( fibs (tail fibs) [0, 1, 1, 2, 3, 5, 8, 13, 21, 34] Prelude You cannot create new definitions at the command prompt these must be placed in files and loaded, as described later. The definition of fib in the last example above is local to that expression and will not be remembered for later use. Also, the expressions entered must fit on a ....
....Any s in the prompt will be replaced by the current module name. The default prompt is s . Set repeat string r#string# Hugs allows the user to recall the last expression entered into the interpreter by typing the characters as part of the next expression: Prelude map (1 ) 1. 10] [2, 3, 4, 5, 6, 7, 8, 9, 10, 11] Prelude filter even [2, 4, 6, 8, 10] Prelude A r#str# option can be used to change the repeat string the symbol used to recall the last expression to #str#. For example, users of Standard ML might be more comfortable using: Prelude :set rit Prelude 6 7 42 Prelude it it ....
[Article contains additional citation context not shown here]
G. Hutton and E. Meijer. Monadic parser combinators. Available from http://www.cs.nott.ac.uk/Department/Staff/gmh/bib.html, 1996.
....existential types with type classes. In order to integrate a new language to be interpreted under our framework, it is necessary to supply the parser, the pretty printer and the semantic specification. We use the Parsec combinator library [35] which is based on the parser combinators described in [22], but the system does not depend on any particular parser library. Regarding pretty printing, we use the library developed in [21] As in the case of parsing, the system does not depend on this particular library. The interactive framework can be configured with a list of languages L s = l 1 , l ....
G. Hutton and E. Meijer. Monadic parser combinators. Technical Report NOTTCS-TR-96-4, University of Nottingham, December 1996.
....type of the parsers and assumes a list of characters as input. It can easily be implemented by straightforward list of successes parsers [2,10] but we also have a version based on the fast, error correcting parser combinators of Swierstra [7,8] A mapping to monadic style parser combinators [4,5] or 2 Baars, L oh, Swierstra infixl 3 ## infixl 4 # , class Parser p where pFail : p a pSucceed : a # p a pSym : Char # p Char ( # ) p (a # b) # p a # p b (##) p a # p a # p a ( a # b) # p a # p b f p = pSucceed f # p parse : ....
Hutton, G. and H. Meijer, Monadic parser combinators, Journal of Functional Programming 8 (1988), pp. 437--444.
....M imico. M imico can work with left recursive context free grammars and allows for an easy specification of precedence and associativity of dyadic infix operators. Some familiarity with functional programming and the language Haskell[Bir98, Hud00] is assumed, as well as with monadic programming[Wad92a, Wad90, Hut92, HM96]. Section 2 describes the input, output, overall behaviour and structure, as well as the general principle behind M imico, by means of simple examples. Subsequent sections discuss the treatment of left recursion, and operator precedence and associativity, respectively. Section 5 synthesizes ....
.... Parsec, instead of another combinator library, was support for error handling (see [Lei00] However, programs generated by M imico use another set of combinators, taken from [Bir98] because Parsec s parser type does not provide support for nondeterministic parsing (see below) As is well known[Wad92b, Hut92, Wad90, HM96], a monadic parser can be viewed as a function that takes a string as input and yields a list of pairs: the first component represents the result of parsing the consumed part of the input string, and the second component represents the unconsumed part of the input after parsing. Taken into ....
Graham Hutton and Erik Meijer. Monadic parser combinators. Tech. rep. NOTTCS-TR-96-4, 1996.
....required, as one has to learn how to setup the Haskell environment, how to generate a lexical analyzer (a tool might be helpful) and how to specify LALR(1) grammars. Once this is clear, developing and modifying a grammar proceeds quite fluently. The parser monads and combinators, introduced in [17], represent a very high level approach to parsing. They exploit the observation that parsing is an inherently sequential process and incorporate, at the same time, the flow of information. Complex parsers are constructed by combining the atomic parsers given in the library using special ....
G. Hutton and E. Meijer. Monadic parser combinators. Technical Report NOTTCS-TR-96-4, University of Nottingham, Dec. 1996.
....required, as one has to learn how to setup the Haskell environment, how to generate a lexical analyzer (a tool might be helpful) and how to specify LALR(1) grammars. Once this is clear, developing and modifying a grammar proceeds quite fluently. The parser monads and combinators, introduced in [17], represent a very high level approach to parsing. They exploit the observation that parsing is an inherently sequential process and incorporate, at the same time, the flow of information. Complex parsers are constructed by combining the atomic parsers given in the library using special ....
G. Hutton and E. Meijer. Monadic parser combinators. Technical Report NOTTCS-TR-96-4, University of Nottingham, Dec. 1996.
....implementing parsers from given grammars has been legendary in the functional programming community for quite a while. We have actually used this principle successfully in the teaching of parsing concepts to students for many years [23] Detailed descriptions of such techniques are given e.g. in [13, 14, 12, 22] (where further references can be found as well) 2 We essentially use the notation of the functional language Opal [24, 10, 11, 26] slightly enriched in order to increase flexibility. But it should be noted that the code would look essentially the same in other functional languages such as Ml, ....
....symbols and thus avoid the one step backtrackings with the subseqeunt fail tests. We conclude this brief sketch by noting that the concrete programming that we have chosen is not obligatory; the details can easily be varied to suit different tastes and styles. For example, Hutton and Meijer [14] design their operators such that they fulfil the monad laws that recently have become so popular in functional programming) Correctness. Even though the above functional parser is so straightforward that its correctness appears to be evident, we present a verifying derivation for the sake of ....
G. Hutton and E. Meijer. Monadic parser combinators. J. Functional Programming, 1(1), May 1993. 73
....error correction, deterministic, partial evaluation, parser generators, program analysis, lazy evaluation, polymorphism 1. INTRODUCTION There exist many di#erent implementations of the basic parser combinators; some use basic functions [3] whereas others make use of a monadic formulation [4]. Parsers constructed with such conventional parser combinators have two disadvantages: when the grammar gets larger parsing gets slower and when the input is not a sentence of the language they break down. In [7] we presented a set of parser combinators that did not exhibit such shortcomings, ....
....input ( res,rest) rs) Left res Figure 1: The basic combinators web site for our combinators 1 . As an example of how to construct parsers using these combinators and of what they return consider (for Symbol we take Int) p = symbol 3 ( symbol 3 symbol 4 ) parser p [3, 4, 5] [ 3, 4, 5] 7, 5] The main shortcoming of the standard implementation is that when the input cannot be parsed the parser returns an empty list, without any indication about where in the input things are most likely to be wrong. As a consequence the combinators in this form are unusable ....
[Article contains additional citation context not shown here]
G. Hutton and H. Meijer. Monadic parser combinators. Journal of Functional Programming, 8(4):437--444, 1988.
....a more complete interpreter using folds or monadic folds depending on the semantic feature modelled. The interpreter is assembled from independent components using extensible union functors. We could even develop a modular parser implementing an algebra for each functor over the Parser monad [9]. Nevertheless, our parser is far from elegant because we need extra parenthesis to allow the modular nature. Another research direction is the modular development of parsers from modular abstract syntax. In this sense, the dual notion of monadic folds, monadic unfolds, could be used to obtain the ....
G. Hutton, E. Meijer, Monadic Parser Combinators. Technical Report.NOTTCS-TR-96-4 (University of Nottingham, 1996).
....to the Maybe monad, but when we use ( we get backtracking because the pattern combinators are instantiated to the list monad. This requires lazy lists for e ciency. The method of using lazy lists for backtracking is explained in Wadler [Wad85] and is also used in combinator parsers [HM96]. 6 Extension III: Value Constructors To de ne the c # equivalents for various c pseudo constructors is often tedious: for example, the list1 # , list2 # , list3 # from above. If c is an instance of the Eq class, c # can simply be a shortcut for pk c , but for functions c, the c ....
....for exhaustiveness and redundancy. Aitken and Reppy [AR92] have a simple approach to making pattern matching more expressive; I ve borrowed their notion of a value constructor . Parser combinators are related to this work, though they are only applicable to matching lists. As Hutton and Meijer [HM96] have shown, monads are useful for designing the combinators. Like my patterns, parser combinators could be parameterized over which monad (list or Maybe) to use (i.e. whether to do backtracking or not) Hughes [Hug98] generalizes monads to what he calls arrows. As his arrows are so general, it ....
Graham Hutton and Erik Meijer. Monadic parser combinators. Technical Report NOTTCS-TR-96-4, University of Nottingham, December 1996.
....functions, and user de ned datatypes. Some of these are illustrated in the following example: Prelude (not True) False False Prelude reverse Hugs is cool looc si sguH Prelude filter even [1. 10] 2, 4, 6, 8, 10] Prelude take 10 fibs where fibs = 0:1:zipWith ( fibs (tail fibs) [0, 1, 1, 2, 3, 5, 8, 13, 21, 34] Prelude You cannot create new de nitions at the command prompt these must be placed in les and loaded, as described later. The de nition of fib in the last example above is local to that expression and will not be remembered for later use. Also, the expressions entered must t on a single ....
....Any s in the prompt will be replaced by the current module name. The default prompt is s . Set repeat string rhstringi Hugs allows the user to recall the last expression entered into the interpreter by typing the characters as part of the next expression: Prelude map (1 ) 1. 10] [2, 3, 4, 5, 6, 7, 8, 9, 10, 11] Prelude filter even [2, 4, 6, 8, 10] Prelude A rhstri option can be used to change the repeat string the symbol used to recall the last expression to hstri. For example, users of Standard ML might be more comfortable using: Prelude :set rit Prelude 6 7 42 Prelude it it 84 ....
[Article contains additional citation context not shown here]
G. Hutton and E. Meijer. Monadic parser combinators. Available from http://www.cs.nott.ac.uk/Department/Staff/gmh/bib.html, 1996.
....conventional tools lack. This paper contains enough room to include the full text of the library; something that can definitely not be said about almost any other existing tool. Parser combinators have been a joy for functional programmers to use, to study, and to create their own versions of [2,1,5]. In many courses on functional programming they form the culminating point, in which the teacher impresses his students with an unbelievably short description of how to write parsers in a functional language. We will do so here too. Next we will explain the advantages of programming with such ....
Hutton, G., Meijer, E. Monadic parser combinators. Journal of Functional Programming, 8(4):437--444, July 1998.
....are also rules to produces instances of NFData and to generate utility functions for types and records. The input to Derive is a Haskell module annotated with preprocessor commands. The input is parsed for type de nitions (data and newtype statements) and commands. Monadic parser combinators [13] were used to construct the parser, which was based on the example given in the paper. It was a simple task 2 from Olaf Chitil chitil informatik.rwth aachen.de 3 Documentation and Code available at http: www.dcs.gla.ac.uk nww derivehome.html 16 to extend the parser to accept record types ....
Graham Hutton and Erik Meijer. Monadic parser combinators. Technical Report NOTTCS-TR-96-4, University of Nottingham, December 1996.
....and user defined datatypes. Some of these are illustrated in the following example: Prelude (not True) False False Prelude reverse Hugs is cool looc si sguH Prelude filter even [1. 10] 2, 4, 6, 8, 10] Prelude take 10 fibs where fibs = 0:1:zipWith ( fibs (tail fibs) [0, 1, 1, 2, 3, 5, 8, 13, 21, 34] Prelude You cannot create new definitions at the command prompt these must be placed in files and loaded, as described later. The definition of fib in the last example above is local to that expression and will not be remembered for later use. Also, the expressions entered must fit on a ....
....Any s in the prompt will be replaced by the current module name. The default prompt is s . Set repeat string rhstringi Hugs allows the user to recall the last expression entered into the interpreter by 22 typing the characters as part of the next expression: Prelude map (1 ) 1. 10] [2, 3, 4, 5, 6, 7, 8, 9, 10, 11] Prelude filter even [2, 4, 6, 8, 10] Prelude A rhstri option can be used to change the repeat string the symbol used to recall the last expression to hstri. For example, users of Standard ML might be more comfortable using: Prelude :set rit Prelude 6 7 42 Prelude it it ....
[Article contains additional citation context not shown here]
G. Hutton and E. Meijer. Monadic parser combinators. Available from http://www.cs.nott.ac.uk/Department/Staff/gmh/bib.html, 1996.
....Building upon this monad the function parse converts the concrete representation of a term into its internal representation. parse : String Maybe Term parse s = run (accepts (do many white; term) s : ParserM Char Term) We have hinted only at the basics of monadic or functional parsing; Hutton and Meijer (1996) give a more in depth treatment of the topic. 3 Constructing monads This section is concerned with the construction of monads which support the operations used in the previous applications. 3.1 Monad transformers Each of the class definitions listed in Section 1.1 defines a certain feature ....
Hutton, Graham, & Meijer, Erik. 1996 (January). Monadic parser combinators. Submitted for publication.
....format by means of combinators. Combinators are functions that take solutions to sub problems and combines them into a solution for the problem, thus capturing very well the idea of modular programming. Several implementations of parsing combinators were proposed [Hut93, Fok95, Wad95, Roj95, HM96] each one with its own features, but providing a particular implementation of combinators, usually with different names. In general, each solution starts defining a type to represent parsers, and then gives the definition for atomic parsers and standard combinators in terms of the base type ....
....parsers, and then gives the definition for atomic parsers and standard combinators in terms of the base type operations. The choice of names for the different parsers and combinators varies from one proposal to another one, but the intention behind them is very similar, when not the same. In [HM96] a monadic generalization in the definition of components is proposed, but this proposal is still based in the provision of a base type for parsers. From the programmer point of view, this wide range of possibilities implies that she needs to mantain several different modules, with several ....
[Article contains additional citation context not shown here]
Graham Hutton and Erik Meijer. Monadic parser combinators. Technical report, University of Nottingham, 1996.
No context found.
G. Hutton, E. Meijer, Monadic parser combinators, JFP 8 (4) (1996) 437--444. 4.2
No context found.
G. Hutton and E. Meijer, Monadic Parser Combinators, J. of Functional Programming, 2(3):323--343, 1992.
No context found.
Graham Hutton and Erik Meijer. Monadic parser combinators. Journal of Functional Programming, 8(4):437--444, 1996.
No context found.
Graham Hutton and Erik Meijer. Monadic parser combinators. Journal of Functional Programming, 8(4):437--444, 1996.
No context found.
G. Hutton and E. Meijer. Monadic parser combinators. J. Functional Programming, 1(1), May 1993.
No context found.
Graham Hutton and Erik Meijer. Monadic parser combinators. Journal of Functional Programming, 8(4):437--444, 1996.
No context found.
Graham Hutton and Erik Meijer. Monadic parser combinators. Journal of Functional Programming, 8(4):437--444, 1996.
No context found.
Graham Hutton and Erik Meijer. (1996) Monadic Parser Combinators. Technical report NOTTCS-TR-96-4. Department of Computer Science, University of Nottingham.
No context found.
Graham Hutton and Erik Meijer. (1996) Monadic Parser Combinators. Technical report NOTTCS-TR-96-4. Department of Computer Science, University of Nottingham.
First 50 documents
Online articles have much greater impact More about CiteSeer.IST Add search form to your site Submit documents Feedback
CiteSeer.IST - Copyright Penn State and NEC