Haskell, Char, Unicode, and Turkish

前端 未结 3 1368
借酒劲吻你
借酒劲吻你 2020-12-28 14:46

For the Char data-type, how do I specify that I want to use the Turkish i instead of the English i for the toLower and toUpper functions?

3条回答
  •  暗喜
    暗喜 (楼主)
    2020-12-28 15:12

    A Simple Matter Of Programming:

    import qualified Data.Char as Char
    
    toLower 'I' = 'ı'
    toLower x   = Char.toLower x
    

    Then

    toLower <$> "I AM LOWERCASE" == "ı am lowercase"  
    

提交回复
热议问题