X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=ghc%2FInteractiveUI.hs;h=82c9aab84c94f400aa208dcbabf7261311c12801;hb=1c83695b5b9ae3175c18908c1d58aeadb1f225ae;hp=d6202907d1515428b4f35ad8f02d0243fad1d5c8;hpb=e16df2647fde526846e4c13470250ee5b475bdd2;p=ghc-hetmet.git diff --git a/ghc/InteractiveUI.hs b/ghc/InteractiveUI.hs index d620290..82c9aab 100644 --- a/ghc/InteractiveUI.hs +++ b/ghc/InteractiveUI.hs @@ -55,6 +55,11 @@ import Maybes ( orElse, expectJust ) import FastString import Encoding +#if __GLASGOW_HASKELL__ < 611 +import Foreign.C +import Encoding +#endif + #ifndef mingw32_HOST_OS import System.Posix hiding (getEnv) #else @@ -88,7 +93,13 @@ import Control.Monad as Monad import Text.Printf import Foreign import GHC.Exts ( unsafeCoerce# ) + +#if __GLASGOW_HASKELL__ >= 611 +import GHC.IO.Exception ( IOErrorType(InvalidArgument) ) +#else import GHC.IOBase ( IOErrorType(InvalidArgument) ) +#endif + import GHC.TopHandler import Data.IORef ( IORef, readIORef, writeIORef ) @@ -501,7 +512,7 @@ fileLoop hdl = do -- this can happen if the user closed stdin, or -- perhaps did getContents which closes stdin at -- EOF. - Right l -> fmap Just (Encoding.decode (BS.pack l)) + Right l -> return (Just l) mkPrompt :: GHCi String mkPrompt = do