-
Notifications
You must be signed in to change notification settings - Fork 25
Open
Labels
Description
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).