Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.
Sign upCrash when using an invalid regular expression #157
Comments
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
Show comment
Hide comment
Dobiasd
Feb 3, 2015
In my opinion the API-breaking change is the better solution. I prefer Result over Maybe, since the exceptions message can be seen then.
Dobiasd
commented
Feb 3, 2015
|
In my opinion the API-breaking change is the better solution. I prefer Result over Maybe, since the exceptions message can be seen then. |
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
Show comment
Hide comment
salutis
Feb 3, 2015
Contributor
+1 for API-breaking changes. The best thing about Elm is that it's opinionated.
|
+1 for API-breaking changes. The best thing about Elm is that it's opinionated. |
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
Show comment
Hide comment
|
Duplicate of #378, which has further discussion. |
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
Show comment
Hide comment
|
Okay, closing this here as a duplicate. |
jvoigtlaender
closed this
Aug 30, 2015
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
jonathanhefner commentedFeb 3, 2015
Issue for discussion thread https://groups.google.com/d/topic/elm-discuss/7Uwl5-usqjs/discussion
Basically, JavaScript's
RegExp(which is what Elm'sRegexsits on top of) can throw an exception when given an invalid string. Examples:The obvious fix is to make Elm's
Regex.regexreturn aResult(or aMaybe), but that seems like a pain to work with. It's also an API-breaking change, which I have no problems with whatsoever, but others might.The only other solution I can think of is to escape characters at the end of an input string until no exception is thrown. For example:
It's a bit hacky though, and may not follow the principle of least surprise. Thoughts?