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 upImprove Regex equality #839
Comments
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
process-bot
Feb 12, 2017
Thanks for the issue! Make sure it satisfies this checklist. My human colleagues will appreciate it!
Here is what to expect next, and if anyone wants to comment, keep these things in mind.
process-bot
commented
Feb 12, 2017
|
Thanks for the issue! Make sure it satisfies this checklist. My human colleagues will appreciate it! Here is what to expect next, and if anyone wants to comment, keep these things in mind. |
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
lukewestby
Mar 3, 2017
Member
@pauldijou can you share some reasons why you would want to check the equality of two regex values?
|
@pauldijou can you share some reasons why you would want to check the equality of two regex values? |
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
pauldijou
Mar 3, 2017
I was messing around implementing a Map (like a Dict but with any type of key) and using Regex as keys broke it since all regexs were considered equals.
pauldijou
commented
Mar 3, 2017
|
I was messing around implementing a |
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
evancz
Mar 26, 2017
Member
Regex is similar to functions when it comes to equality. We will eventually be able to disallow using (==) on them statically, but it's not possible for now. So this will be "improved" by turning it into a compilation error once the compiler work happens.
|
|
evancz
closed this
Mar 26, 2017
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
jvoigtlaender
Mar 26, 2017
Contributor
Maybe a note about Regex at http://package.elm-lang.org/packages/elm-lang/core/latest/Basics#== would be in place.
|
Maybe a note about Regex at http://package.elm-lang.org/packages/elm-lang/core/latest/Basics#== would be in place. |
pauldijou commentedFeb 12, 2017
Right now, any Elm regex is considered equal to any other regex even if their definitions are totally different. Check demo.
Maybe improve
Native.Utils.eqto perform a special check when testing regexps. Found this code browsing SO: