Data.CharのisAlphaはマルチバイト文字を正しく扱えない
isAlphaNumも同様。
まじ注意。
Prelude> import Data.Char
Prelude Data.Char> isAlpha 'あ'
True
Prelude Data.Char> isAlphaNum 'あ'
True
これを定義しておけばいいんだけど、他にどっかData.Text以下あたりでexportしてないかなー。
isAlpha' :: Char -> Bool
isAlpha' c = c `elem` ['A'..'Z']
|| c `elem` ['a'..'z']
isAlphaNum' :: Char -> Bool
isAlphaNum' c = c `elem` ['A'..'Z']
|| c `elem` ['a'..'z']
|| c `elem` ['0'..'9']