howyp / ropes

Stronger strings! Declare your string format as a type, and get parsers, writers, composition and generators for free.
https://howyp.github.io/ropes/
Apache License 2.0
7 stars 0 forks source link

Could `Range` be generalised to be more flexible? #31

Closed howyp closed 5 years ago

howyp commented 5 years ago

Regexes allow character classes to be specified such as [A-Za-z_=], while the Range type only allows a single range to be specified. Maybe we could create a CharacterClass which would allow specification of multiple ranges or single characters to include or exclude? For example:

CharacterClass[('A', 'Z') :+: ('a', 'z') :+: '_' :+: '=']