Skip to content

Remove exceptions from combinator parsers #95

@ceilican

Description

@ceilican

Andreas wrote:

isn't throwing exceptions considered to be a side effect and therefore the whole thing is not purely functional anymore?
In other words: aren't exceptions supposed to be handeled differently with combinational parsers?

There are lambda calculi with exceptions and there are functional languages with exceptions. Whether this makes them less pure is subjective, unless "purity" is objectively defined first. But you are right that there are better ways to handle and report errors when using combinator parsers. Scala provides the "failure" parser and the "Failure" parse-result for that. They are explained in chapter 31.9 of "Programming in Scala" (http://www.artima.com/pins1ed/combinator-parsing.html).

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions