Skip to content
This repository was archived by the owner on Aug 3, 2024. It is now read-only.
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion haddock-api/src/Haddock/Backends/Hoogle.hs
Original file line number Diff line number Diff line change
Expand Up @@ -204,7 +204,7 @@ ppSynonym dflags x = [out dflags x]

ppData :: DynFlags -> TyClDecl Name -> [(Name, DocForDecl Name)] -> [String]
ppData dflags decl@(DataDecl { tcdDataDefn = defn }) subdocs
= showData decl{ tcdDataDefn = defn { dd_cons=[],dd_derivs=Nothing }} :
= showData decl{ tcdDataDefn = defn { dd_cons=[],dd_derivs=noLoc [] }} :
concatMap (ppCtor dflags decl subdocs . unL) (dd_cons defn)
where

Expand Down
4 changes: 2 additions & 2 deletions haddock-api/src/Haddock/Convert.hs
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@ synifyTyCon _coax tc
, dd_kindSig = Just (synifyKindSig (tyConKind tc))
-- we have their kind accurately:
, dd_cons = [] -- No constructors
, dd_derivs = Nothing }
, dd_derivs = noLoc [] }
, tcdDataCusk = False
, tcdFVs = placeHolderNamesTc }

Expand Down Expand Up @@ -224,7 +224,7 @@ synifyTyCon coax tc
consRaw = map (synifyDataCon use_gadt_syntax) (tyConDataCons tc)
cons = rights consRaw
-- "deriving" doesn't affect the signature, no need to specify any.
alg_deriv = Nothing
alg_deriv = noLoc []
defn = HsDataDefn { dd_ND = alg_nd
, dd_ctxt = alg_ctx
, dd_cType = Nothing
Expand Down
5 changes: 3 additions & 2 deletions haddock-api/src/Haddock/Interface/Create.hs
Original file line number Diff line number Diff line change
Expand Up @@ -349,8 +349,9 @@ subordinates instMap decl = case decl of
, L _ (ConDeclField ns _ doc) <- (unLoc flds)
, L _ n <- ns ]
derivs = [ (instName, [unL doc], M.empty)
| Just (L _ tys) <- [dd_derivs dd]
, HsIB { hsib_body = L l (HsDocTy _ doc) } <- tys
| HsIB { hsib_body = L l (HsDocTy _ doc) }
<- concatMap (unLoc . deriv_clause_tys . unLoc) $
unLoc $ dd_derivs dd
, Just instName <- [M.lookup l instMap] ]

-- | Extract function argument docs from inside types.
Expand Down
5 changes: 4 additions & 1 deletion haddock-api/src/Haddock/Interface/Rename.hs
Original file line number Diff line number Diff line change
Expand Up @@ -416,7 +416,8 @@ renameDataDefn (HsDataDefn { dd_ND = nd, dd_ctxt = lcontext, dd_cType = cType
cons' <- mapM (mapM renameCon) cons
-- I don't think we need the derivings, so we return Nothing
return (HsDataDefn { dd_ND = nd, dd_ctxt = lcontext', dd_cType = cType
, dd_kindSig = k', dd_cons = cons', dd_derivs = Nothing })
, dd_kindSig = k', dd_cons = cons'
, dd_derivs = noLoc [] })

renameCon :: ConDecl Name -> RnM (ConDecl DocName)
renameCon decl@(ConDeclH98 { con_name = lname, con_qvars = ltyvars
Expand Down Expand Up @@ -509,9 +510,11 @@ renameInstD (DataFamInstD { dfid_inst = d }) = do

renameDerivD :: DerivDecl Name -> RnM (DerivDecl DocName)
renameDerivD (DerivDecl { deriv_type = ty
, deriv_strategy = strat
, deriv_overlap_mode = omode }) = do
ty' <- renameLSigType ty
return (DerivDecl { deriv_type = ty'
, deriv_strategy = strat
, deriv_overlap_mode = omode })

renameClsInstD :: ClsInstDecl Name -> RnM (ClsInstDecl DocName)
Expand Down