You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If the locale field LC_MESSAGES is set to a non-English language, Hint produces an GhcException.
The following demonstrates the bug. If LC_MESSAGES is set to "C" or "en_US.UTF-8", the program completes normally. Otherwise, there is an error. This program assumes that the system on which it's running supports the fr_FR locale. A list of available locales can be obtained by running locale -a on the command-line.
import System.Locale.SetLocale (setLocale, Category(LC_MESSAGES))
import Language.Haskell.Interpreter (InterpreterError (GhcException, NotAllowed, UnknownError, WontCompile), errMsg, runInterpreter)
main = do
-- locale <- setLocale LC_MESSAGES $ Just "C" -- This works
locale <- setLocale LC_MESSAGES $ Just "fr_FR.UTF-8" -- This fails
case locale of
Nothing -> putStrLn "Unable to set LC_MESSAGES"
Just lc_messages -> putStrLn $ "LC_MESSAGES = " ++ lc_messages
r <- runInterpreter $ return ()
case r of
Left (UnknownError msg) -> putStrLn $ "UnknownError : " ++ msg
Left (WontCompile []) -> putStrLn "WontCompile"
Left (WontCompile (err:_)) -> putStrLn $ "WontCompile : " ++ (errMsg err)
Left (NotAllowed msg) -> putStrLn $ "NotAllowed : " ++ msg
Left (GhcException msg) -> putStrLn $ "GhcException : " ++ msg
Right () -> putStrLn "Success"
The text was updated successfully, but these errors were encountered:
If the locale field LC_MESSAGES is set to a non-English language, Hint produces an GhcException.
The following demonstrates the bug. If
LC_MESSAGES
is set to"C"
or"en_US.UTF-8"
, the program completes normally. Otherwise, there is an error. This program assumes that the system on which it's running supports thefr_FR
locale. A list of available locales can be obtained by runninglocale -a
on the command-line.The text was updated successfully, but these errors were encountered: