(*> & more)
Composes two or more parsers returning the result of the rightmost one.
Composes two or more parsers returning the result of the rightmost one.
(<$> f & more)
Maps the function f to the results of the given parsers, applicative functor result is going to be a parameter for function f.
Example:
(<$> + number number)
Where number
is a parser that will return a number from the parsed input.
Maps the function f to the results of the given parsers, applicative functor result is going to be a parameter for function f. Example: (<$> + number number) Where `number` is a parser that will return a number from the parsed input.
(<* & more)
Composes two or more parsers, returning the result of the leftmost one.
Composes two or more parsers, returning the result of the leftmost one.
(add-parser-stream input0 more0 input1 more1 f)
Concats the input and more
flag from two different parsers and calls
the function f with the result.
Concats the input and `more` flag from two different parsers and calls the function f with the result.
(always a)
Returns a parser that will always succeed, this parser will return the parameter given.
Returns a parser that will always succeed, this parser will return the parameter given.
(bind-parsers p f)
Receives a parser and a continuation function, the result of the parser is going to be given as a parameter to the f function, and this function should return a new parser.
Example:
; Everytime we parse an 'a' character and return a "hello" string (bind-parsers (char \a) (fn [achr] (always "hello")))
Receives a parser and a continuation function, the result of the parser is going to be given as a parameter to the f function, and this function should return a new parser. Example: ; Everytime we parse an 'a' character and return a "hello" string (bind-parsers (char \a) (fn [achr] (always "hello")))
Constant value that indicates if the stream of the parser is complete (no more input).
Constant value that indicates if the stream of the parser is complete (no more input).
(complete? m)
Test More flag is equal to the complete constant or not.
Test More flag is equal to the complete constant or not.
(do-parser & body)
Allows the use of 'run-mdo' statements with the bind and return functions binded to the parser-m monad.
Allows the use of 'run-mdo' statements with the bind and return functions binded to the parser-m monad.
(done? result)
Returns true when the parser has successfuly parsed the given input.
Returns true when the parser has successfuly parsed the given input.
(fail-parser msg)
Parser that will always fail, you may provide an error message msg that will be shown on the final result.
Parser that will always fail, you may provide an error message msg that will be shown on the final result.
(failure? result)
Returns true when the parser has failed when parsing the given input.
Returns true when the parser has failed when parsing the given input.
Constant value that indicates if the stream of the parser is incomplete (more input to come).
Constant value that indicates if the stream of the parser is incomplete (more input to come).
(incomplete? m)
Test More flag is equal to the incomplete constant or not.
Test More flag is equal to the incomplete constant or not.
(join-parsers p1 p2)
Merges two parsers together and returns a new parser that will execute parser p1, in case this fails, it is going to execute parser p2.
Example:
;; Parses either the character a or the character b (join-parsers (char \a) (char \b))
Merges two parsers together and returns a new parser that will execute parser p1, in case this fails, it is going to execute parser p2. Example: ;; Parses either the character a or the character b (join-parsers (char \a) (char \b))
(parse parser input)
Uses the given parser to process the input, this function may return a result that could either be a success, a failure, or a continuation that will require more input in other to finish. The parser continuation will halt as soon as an empty seq is given.
Uses the given parser to process the input, this function may return a result that could either be a success, a failure, or a continuation that will require more input in other to finish. The parser continuation will halt as soon as an empty seq is given.
(parse-once parser input)
Uses the given parser to process the input, this may return a result that could either be a success or failure result (All input must be available at once when using this function).
Uses the given parser to process the input, this may return a result that could either be a success or failure result (All input must be available at once when using this function).
Returns true when the parser requires more input in order to complete.
Returns true when the parser requires more input in order to complete.
(prompt input0 _more0 err-fn ok-fn)
This is parser is used to return continuations (when there is not enough input available for the parser to either succeed or fail).
This is parser is used to return continuations (when there is not enough input available for the parser to either succeed or fail).
(with-parser & forms)
Allows the use of monadic functions bind and return which are binded to the parser-m monad.
Allows the use of monadic functions bind and return which are binded to the parser-m monad.
cljdoc is a website building & hosting documentation for Clojure/Script libraries
× close