diff options
| author | Alan Zimmerman <alan.zimm@gmail.com> | 2018-04-19 14:04:04 +0200 | 
|---|---|---|
| committer | Alan Zimmerman <alan.zimm@gmail.com> | 2018-04-27 15:36:53 +0200 | 
| commit | 271a9cb0c7a070deef8df2d4fb54ebe47a0bf560 (patch) | |
| tree | db4c5f3609760f44e3571a33419a726f42af6f54 /haddock-api/src/Haddock/Backends/Hoogle.hs | |
| parent | 0d903e5e7ea877cbf6e8a7a84c9c8b6ef8c78ef6 (diff) | |
Match changes in GHC for TTG
Diffstat (limited to 'haddock-api/src/Haddock/Backends/Hoogle.hs')
| -rw-r--r-- | haddock-api/src/Haddock/Backends/Hoogle.hs | 21 | 
1 files changed, 11 insertions, 10 deletions
| diff --git a/haddock-api/src/Haddock/Backends/Hoogle.hs b/haddock-api/src/Haddock/Backends/Hoogle.hs index 09f62a19..2c7be079 100644 --- a/haddock-api/src/Haddock/Backends/Hoogle.hs +++ b/haddock-api/src/Haddock/Backends/Hoogle.hs @@ -126,12 +126,12 @@ ppExport dflags ExportDecl { expItemDecl    = L _ decl                             , expItemFixities = fixities                             } = ppDocumentation dflags dc ++ f decl      where -        f (TyClD d@DataDecl{})  = ppData dflags d subdocs -        f (TyClD d@SynDecl{})   = ppSynonym dflags d -        f (TyClD d@ClassDecl{}) = ppClass dflags d subdocs -        f (ForD (ForeignImport name typ _ _)) = [pp_sig dflags [name] (hsSigType typ)] -        f (ForD (ForeignExport name typ _ _)) = [pp_sig dflags [name] (hsSigType typ)] -        f (SigD sig) = ppSig dflags sig ++ ppFixities +        f (TyClD _ d@DataDecl{})  = ppData dflags d subdocs +        f (TyClD _ d@SynDecl{})   = ppSynonym dflags d +        f (TyClD _ d@ClassDecl{}) = ppClass dflags d subdocs +        f (ForD _ (ForeignImport _ name typ _)) = [pp_sig dflags [name] (hsSigType typ)] +        f (ForD _ (ForeignExport _ name typ _)) = [pp_sig dflags [name] (hsSigType typ)] +        f (SigD _ sig) = ppSig dflags sig ++ ppFixities          f _ = []          ppFixities = concatMap (ppFixity dflags) fixities @@ -189,7 +189,7 @@ ppClass dflags decl subdocs =              , tcdTyVars = feqn_pats tfe              , tcdFixity = feqn_fixity tfe              , tcdRhs    = feqn_rhs tfe -            , tcdFVs    = emptyNameSet +            , tcdSExt   = emptyNameSet              } @@ -241,8 +241,8 @@ ppCtor dflags dat subdocs con@ConDeclH98 {}                             [out dflags (map (extFieldOcc . unLoc) $ cd_fld_names r) `typeSig` [resType, cd_fld_type r]]                            | r <- map unLoc recs] -        funs = foldr1 (\x y -> reL $ HsFunTy PlaceHolder x y) -        apps = foldl1 (\x y -> reL $ HsAppTy PlaceHolder x y) +        funs = foldr1 (\x y -> reL $ HsFunTy NoExt x y) +        apps = foldl1 (\x y -> reL $ HsAppTy NoExt x y)          typeSig nm flds = operator nm ++ " :: " ++ outHsType dflags (unL $ funs flds) @@ -250,7 +250,7 @@ ppCtor dflags dat subdocs con@ConDeclH98 {}          -- docs for con_names on why it is a list to begin with.          name = commaSeparate dflags . map unL $ getConNames con -        resType = apps $ map (reL . HsTyVar PlaceHolder NotPromoted . reL) $ +        resType = apps $ map (reL . HsTyVar NoExt NotPromoted . reL) $                          (tcdName dat) : [hsTyVarName v | L _ v@(UserTyVar _ _) <- hsQTvExplicit $ tyClDeclTyVars dat]  ppCtor dflags _dat subdocs con@(ConDeclGADT { }) @@ -260,6 +260,7 @@ ppCtor dflags _dat subdocs con@(ConDeclGADT { })          typeSig nm ty = operator nm ++ " :: " ++ outHsType dflags (unL ty)          name = out dflags $ map unL $ getConNames con +ppCtor _ _ _ XConDecl {} = panic "haddock:ppCtor"  ppFixity :: DynFlags -> (Name, Fixity) -> [String]  ppFixity dflags (name, fixity) = [out dflags ((FixitySig noExt [noLoc name] fixity) :: FixitySig GhcRn)] | 
