I wanted to write a function that checks what Charthe Cyrillic alphabet represents, solely for pedagogical reasons. A simple approximation for a Russian is
isCyrillic c =
let lc = toLower c
in '' <= lc && lc <= ''
but I donโt like it because it doesnโt process other languages โโthat use Cyrillic. I could hard set ranges:
U+0400โU+04FF Cyrillic
U+0500โU+052F Cyrillic Supplement
U+2DE0โU+2DFF Cyrillic Extended-A
U+A640โU+A69F Cyrillic Extended-B
U+1C80โU+1C8F Cyrillic Extended-C
but this is not good practice either.
Ideally, the function would be simple
isCyrillic c = unicodeScript c == Cyrillic
but this assumes the existence of a type of enumerated Unicode scripts (Unicode ranges will also work). Is there anywhere?
source
share