[opinionated] use Unicode Consortium file to generate guards.
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.
Coverage decreased (-0.7%) to 95.238% when pulling b1db461767e782974c0e78e96c69cb97e1d216a6 on am-kantox:feature/guards-for-upper-lower into aea2153c991c3f27fedfbc48107fda35e835d959 on sobolevn:master.
the
Recasemethods work faster
How much faster?