defining typeForUser.

This commit is contained in:
Kazu Yamamoto 2013-11-19 12:35:42 +09:00
parent 7fbd983172
commit 13738d4391
2 changed files with 9 additions and 6 deletions

View File

@ -20,6 +20,7 @@ module Language.Haskell.GhcMod.Gap (
, pprInfo , pprInfo
, HasType(..) , HasType(..)
, errorMsgSpan , errorMsgSpan
, typeForUser
#if __GLASGOW_HASKELL__ >= 702 #if __GLASGOW_HASKELL__ >= 702
#else #else
, module Pretty , module Pretty
@ -290,3 +291,10 @@ errorMsgSpan = errMsgSpan
#else #else
errorMsgSpan = head . errMsgSpans errorMsgSpan = head . errMsgSpans
#endif #endif
typeForUser :: Type -> SDoc
#if __GLASGOW_HASKELL__ >= 707
typeForUser = pprTypeForUser
#else
typeForUser = pprTypeForUser False
#endif

View File

@ -29,7 +29,6 @@ import qualified Language.Haskell.GhcMod.Gap as Gap
import Language.Haskell.GhcMod.Gap (HasType(..)) import Language.Haskell.GhcMod.Gap (HasType(..))
import Language.Haskell.GhcMod.Types import Language.Haskell.GhcMod.Types
import Outputable import Outputable
import PprTyThing
import TcHsSyn (hsPatType) import TcHsSyn (hsPatType)
import TcRnTypes import TcRnTypes
@ -152,11 +151,7 @@ listifyStaged :: Typeable r => Stage -> (r -> Bool) -> GenericQ [r]
listifyStaged s p = everythingStaged s (++) [] ([] `mkQ` (\x -> [x | p x])) listifyStaged s p = everythingStaged s (++) [] ([] `mkQ` (\x -> [x | p x]))
pretty :: DynFlags -> Type -> String pretty :: DynFlags -> Type -> String
#if __GLASGOW_HASKELL__ >= 707 pretty dflag = showUnqualifiedOneLine dflag . Gap.typeForUser
pretty dflag = showUnqualifiedOneLine dflag . pprTypeForUser
#else
pretty dflag = showUnqualifiedOneLine dflag . pprTypeForUser False
#endif
---------------------------------------------------------------- ----------------------------------------------------------------