Skip to content

Conversation

@am-kantox
Copy link
Contributor

This is a very opinionated approach to eliminate regular expressions at all.

Basically, I have the implementation partially stolen from Elixir core. It parses the Consortium Unicode spec files to produce is_lowercase/1 and is_uppercase/1 guards alongside with casing/1 function returning :upper | :lower | :not_a_letter.

Due to the parsing/clause generation stage, it compiles ≈20secs, but I consider it’s affordable because normally it happens only once per project/environment. Thanks to generated guards, the Recase methods work faster than the generic clause with ~r/\p{Ll}\p{Lu}/ as we had in the previous version.

@coveralls
Copy link

Coverage Status

Coverage decreased (-0.7%) to 95.238% when pulling b1db461 on am-kantox:feature/guards-for-upper-lower into aea2153 on sobolevn:master.

@sobolevn
Copy link
Member

sobolevn commented Feb 18, 2019

the Recase methods work faster

How much faster?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants