Update src/IHaskell/Eval/Info.hs

This commit is contained in:
Vaibhav Sagar 2017-09-01 00:38:43 +07:00
parent 1809f8c2c0
commit 932886e218

View File

@ -1,4 +1,4 @@
{-# LANGUAGE NoImplicitPrelude, OverloadedStrings #-}
{-# LANGUAGE CPP, NoImplicitPrelude, OverloadedStrings #-}
{- | Description : Inspect type and function information and documentation. -}
module IHaskell.Eval.Info (info) where
@ -19,7 +19,11 @@ import Exception
info :: String -> Interpreter String
info name = ghandle handler $ do
dflags <- getSessionDynFlags
#if MIN_VERSION_ghc(8,2,0)
result <- exprType TM_Inst name
#else
result <- exprType name
#endif
return $ typeCleaner $ showPpr dflags result
where
handler :: SomeException -> Interpreter String