X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=ghc%2Fcompiler%2Ftypecheck%2FTcKind.lhs;h=20b0ff1c7a2c4b49f5127d6bc28f9a158ba49353;hb=edeb362f70b892ae56ad97a6b308ce53f8a4c2fd;hp=5e7becfa5c9e1df4aad257b921f668c21fc9b874;hpb=5cf27e8f1731c52fe63a5b9615f927484164c61b;p=ghc-hetmet.git diff --git a/ghc/compiler/typecheck/TcKind.lhs b/ghc/compiler/typecheck/TcKind.lhs index 5e7becf..20b0ff1 100644 --- a/ghc/compiler/typecheck/TcKind.lhs +++ b/ghc/compiler/typecheck/TcKind.lhs @@ -1,4 +1,6 @@ \begin{code} +#include "HsVersions.h" + module TcKind ( Kind, mkTypeKind, mkBoxedTypeKind, mkUnboxedTypeKind, mkArrowKind, @@ -14,14 +16,17 @@ module TcKind ( tcDefaultKind -- TcKind s -> NF_TcM s Kind ) where -import Ubiq{-uitous-} +IMP_Ubiq(){-uitous-} import Kind -import TcMonad hiding ( rnMtoTcM ) +import TcMonad import Unique ( Unique, pprUnique10 ) import Pretty import Util ( nOfThem ) +#if __GLASGOW_HASKELL__ >= 202 +import Outputable +#endif \end{code} @@ -177,13 +182,13 @@ instance Outputable (TcKind s) where ppr sty kind = ppr_kind sty kind ppr_kind sty TcTypeKind - = ppStr "*" + = char '*' ppr_kind sty (TcArrowKind kind1 kind2) - = ppSep [ppr_parend sty kind1, ppStr "->", ppr_kind sty kind2] + = sep [ppr_parend sty kind1, ptext SLIT("->"), ppr_kind sty kind2] ppr_kind sty (TcVarKind uniq box) - = ppBesides [ppStr "k", pprUnique10 uniq] + = hcat [char 'k', pprUnique10 uniq] -ppr_parend sty kind@(TcArrowKind _ _) = ppBesides [ppChar '(', ppr_kind sty kind, ppChar ')'] +ppr_parend sty kind@(TcArrowKind _ _) = hcat [char '(', ppr_kind sty kind, char ')'] ppr_parend sty other_kind = ppr_kind sty other_kind \end{code} @@ -193,20 +198,17 @@ Errors and contexts ~~~~~~~~~~~~~~~~~~~ \begin{code} unifyKindCtxt kind1 kind2 sty - = ppHang (ppStr "When unifying two kinds") 4 - (ppSep [ppr sty kind1, ppStr "and", ppr sty kind2]) + = hang (ptext SLIT("When unifying two kinds")) 4 + (sep [ppr sty kind1, ptext SLIT("and"), ppr sty kind2]) kindOccurCheck kind1 kind2 sty - = ppHang (ppStr "Cannot construct the infinite kind:") 4 - (ppSep [ppBesides [ppStr "`", ppr sty kind1, ppStr "'"], - ppStr "=", - ppBesides [ppStr "`", ppr sty kind1, ppStr "'"], - ppStr "(\"occurs check\")"]) + = hang (ptext SLIT("Cannot construct the infinite kind:")) 4 + (sep [ppr sty kind1, equals, ppr sty kind1, ptext SLIT("(\"occurs check\")")]) kindMisMatchErr kind1 kind2 sty - = ppHang (ppStr "Couldn't match the kind") 4 - (ppSep [ppBesides [ppStr "`", ppr sty kind1, ppStr "'"], - ppStr "against", - ppBesides [ppStr "`", ppr sty kind2, ppStr "'"] - ]) + = hang (ptext SLIT("Couldn't match the kind")) 4 + (sep [ppr sty kind1, + ptext SLIT("against"), + ppr sty kind2] + ) \end{code}