From 13738d43916e698dc0491134bf7a6b7606353dfe Mon Sep 17 00:00:00 2001 From: Kazu Yamamoto Date: Tue, 19 Nov 2013 12:35:42 +0900 Subject: [PATCH] defining typeForUser. --- Language/Haskell/GhcMod/Gap.hs | 8 ++++++++ Language/Haskell/GhcMod/Info.hs | 7 +------ 2 files changed, 9 insertions(+), 6 deletions(-) diff --git a/Language/Haskell/GhcMod/Gap.hs b/Language/Haskell/GhcMod/Gap.hs index 5f407a1..f0fe97a 100644 --- a/Language/Haskell/GhcMod/Gap.hs +++ b/Language/Haskell/GhcMod/Gap.hs @@ -20,6 +20,7 @@ module Language.Haskell.GhcMod.Gap ( , pprInfo , HasType(..) , errorMsgSpan + , typeForUser #if __GLASGOW_HASKELL__ >= 702 #else , module Pretty @@ -290,3 +291,10 @@ errorMsgSpan = errMsgSpan #else errorMsgSpan = head . errMsgSpans #endif + +typeForUser :: Type -> SDoc +#if __GLASGOW_HASKELL__ >= 707 +typeForUser = pprTypeForUser +#else +typeForUser = pprTypeForUser False +#endif diff --git a/Language/Haskell/GhcMod/Info.hs b/Language/Haskell/GhcMod/Info.hs index 5f8c530..590c476 100644 --- a/Language/Haskell/GhcMod/Info.hs +++ b/Language/Haskell/GhcMod/Info.hs @@ -29,7 +29,6 @@ import qualified Language.Haskell.GhcMod.Gap as Gap import Language.Haskell.GhcMod.Gap (HasType(..)) import Language.Haskell.GhcMod.Types import Outputable -import PprTyThing import TcHsSyn (hsPatType) import TcRnTypes @@ -152,11 +151,7 @@ listifyStaged :: Typeable r => Stage -> (r -> Bool) -> GenericQ [r] listifyStaged s p = everythingStaged s (++) [] ([] `mkQ` (\x -> [x | p x])) pretty :: DynFlags -> Type -> String -#if __GLASGOW_HASKELL__ >= 707 -pretty dflag = showUnqualifiedOneLine dflag . pprTypeForUser -#else -pretty dflag = showUnqualifiedOneLine dflag . pprTypeForUser False -#endif +pretty dflag = showUnqualifiedOneLine dflag . Gap.typeForUser ----------------------------------------------------------------