diff options
author | Ben Gamari <ben@smart-cactus.org> | 2016-02-07 23:34:52 +0100 |
---|---|---|
committer | Ben Gamari <ben@smart-cactus.org> | 2016-02-07 23:34:52 +0100 |
commit | 57a5dcfd3d2a7e01229a2c3a79b1f99cd95d5de1 (patch) | |
tree | 9ba82bbdc7dfa12590259118838dcd8608859e87 /haddock-api/src/Haddock | |
parent | 8269b349dd04f7561f9fe6c9e4ba514d3a7d21ab (diff) | |
parent | af205d20bf3502b41e4fd34b1c991d5014388004 (diff) |
Merge branch 'master' into ghc-head
Diffstat (limited to 'haddock-api/src/Haddock')
-rw-r--r-- | haddock-api/src/Haddock/Convert.hs | 16 |
1 files changed, 13 insertions, 3 deletions
diff --git a/haddock-api/src/Haddock/Convert.hs b/haddock-api/src/Haddock/Convert.hs index b6dd06e9..96a1c01c 100644 --- a/haddock-api/src/Haddock/Convert.hs +++ b/haddock-api/src/Haddock/Convert.hs @@ -33,9 +33,10 @@ import TcType ( tcSplitSigmaTy ) import TyCon import Type import TyCoRep -import TysPrim ( alphaTyVars ) -import TysWiredIn ( listTyConName ) -import PrelNames ( hasKey, eqTyConKey, ipClassKey ) +import TysPrim ( alphaTyVars, unliftedTypeKindTyConName ) +import TysWiredIn ( listTyConName, starKindTyConName ) +import PrelNames ( hasKey, eqTyConKey, ipClassKey + , tYPETyConKey, liftedDataConKey, unliftedDataConKey ) import Unique ( getUnique ) import Util ( filterByList, filterOut ) import Var @@ -360,6 +361,15 @@ synifySigWcType s ty = mkEmptyImplicitBndrs (mkEmptyWildCardBndrs (synifyType s synifyType :: SynifyTypeState -> Type -> LHsType Name synifyType _ (TyVarTy tv) = noLoc $ HsTyVar $ noLoc (getName tv) synifyType _ (TyConApp tc tys) + -- Use */# instead of TYPE 'Lifted/TYPE 'Unlifted (#473) + | tc `hasKey` tYPETyConKey + , [TyConApp lev []] <- tys + , lev `hasKey` liftedDataConKey + = noLoc (HsTyVar (noLoc starKindTyConName)) + | tc `hasKey` tYPETyConKey + , [TyConApp lev []] <- tys + , lev `hasKey` unliftedDataConKey + = noLoc (HsTyVar (noLoc unliftedTypeKindTyConName)) -- Use non-prefix tuple syntax where possible, because it looks nicer. | Just sort <- tyConTuple_maybe tc , tyConArity tc == length tys |