You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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).
The text was updated successfully, but these errors were encountered:
Andreas wrote:
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).
The text was updated successfully, but these errors were encountered: