Turkish is generally challenging for i18n related software particularly because of its special case for the I, ı, İ, i letters. The problem is discussed in detail here
Haskell has recently got complete support for various Unicode services through texttext-icu text text-icu author’s blog
The following is a Haskell code snippet which shows an example of case mapping for Turkish using the mentioned packages.
import Data.Text (pack, unpack)
import Data.Text.ICU (LocaleName(Locale), toLower)
main = do
let trLocale = Locale "tr-TR"
let upStr = "ÇIİĞÖŞÜ"
let lowStr = unpack $ toLower trLocale $ pack upStr
putStrLn $ "toLower " ++ upStr ++ " gives " ++ lowStr
The program simply outputs (as expected):
toLower ÇIİĞÖŞÜ gives çıiğöşü
Perhaps one thing that needs to be explained regarding this code is that pack and unpack are used there for converting from String to Text and vise-versa as required by the packages we use.
Although the code is a little bit imperative (well, I am new to Haskell ;-) ) it should give an idea of how to use the functionality for Turkish or any other language or locale.