Module "Parser.curry"

Library with functional logic parser combinators.
Adapted from: Rafael Caballero and Francisco J. Lopez-Fraguas: A Functional Logic Perspective of Parsing. In Proc. FLOPS'99, Springer LNCS 1722, pp. 85-99, 1999

Author: Michael Hanus

Version: March 2000


 Exported names:

Datatypes:
Parser | ParserRep

Functions:
<*> | <|> | <||> | >>> | empty | satisfy | some | star | terminal


 Summary of exported functions:

(<|>)  :: ([a] -> [a]) -> ([a] -> [a]) -> [a] -> [a]  non-deterministic 
          Combines two parsers without representation in an alternative manner.
(<||>)  :: (a -> [b] -> [b]) -> (a -> [b] -> [b]) -> a -> [b] -> [b]  deterministic 
          Combines two parsers with representation in an alternative manner.
(<*>)  :: ([a] -> [a]) -> ([a] -> [a]) -> [a] -> [a]  deterministic 
          Combines two parsers (with or without representation) in a sequential manner.
(>>>)  :: ([a] -> [a]) -> b -> b -> [a] -> [a]  deterministic 
          Attaches a representation to a parser without representation.
empty  :: [a] -> [a]  deterministic 
          The empty parser which recognizes the empty word.
terminal  :: a -> [a] -> [a]  deterministic flexible
          A parser recognizing a particular terminal symbol.
satisfy  :: (a -> Bool) -> a -> [a] -> [a]  deterministic flexible
          A parser (with representation) recognizing a terminal satisfying a given predicate.
star  :: (a -> [b] -> [b]) -> [a] -> [b] -> [b]  deterministic 
          A star combinator for parsers.
some  :: (a -> [b] -> [b]) -> [a] -> [b] -> [b]  deterministic 
          A some combinator for parsers.

 Imported modules:

Prelude

 Exported datatypes:

Parser

Type synonym: Parser a = [a] -> [a]


ParserRep

Type synonym: ParserRep a b = a -> [b] -> [b]



 Exported functions:

(<|>) :: ([a] -> [a]) -> ([a] -> [a]) -> [a] -> [a]  non-deterministic 

Combines two parsers without representation in an alternative manner.

Further infos:
  • defined as right-associative infix operator with precedence 2

(<||>) :: (a -> [b] -> [b]) -> (a -> [b] -> [b]) -> a -> [b] -> [b]  deterministic 

Combines two parsers with representation in an alternative manner.

Further infos:
  • defined as right-associative infix operator with precedence 2

(<*>) :: ([a] -> [a]) -> ([a] -> [a]) -> [a] -> [a]  deterministic 

Combines two parsers (with or without representation) in a sequential manner.

Further infos:
  • defined as right-associative infix operator with precedence 4

(>>>) :: ([a] -> [a]) -> b -> b -> [a] -> [a]  deterministic 

Attaches a representation to a parser without representation.

Further infos:
  • defined as right-associative infix operator with precedence 3

empty :: [a] -> [a]  deterministic 

The empty parser which recognizes the empty word.

Further infos:
  • solution complete, i.e., able to compute all solutions

terminal :: a -> [a] -> [a]  deterministic flexible

A parser recognizing a particular terminal symbol.

Further infos:
  • incompletely defined

satisfy :: (a -> Bool) -> a -> [a] -> [a]  deterministic flexible

A parser (with representation) recognizing a terminal satisfying a given predicate.

Further infos:
  • incompletely defined

star :: (a -> [b] -> [b]) -> [a] -> [b] -> [b]  deterministic 

A star combinator for parsers. The returned parser repeats zero or more times a parser p with representation and returns the representation of all parsers in a list.


some :: (a -> [b] -> [b]) -> [a] -> [b] -> [b]  deterministic 

A some combinator for parsers. The returned parser repeats the argument parser (with representation) at least once.



Generated by CurryDoc (Version 0.4.1 of June 7, 2007) at Jun 16 17:14:54 2009