aboutsummaryrefslogtreecommitdiff
path: root/haddock-api
diff options
context:
space:
mode:
authorRyan Scott <ryan.gl.scott@gmail.com>2018-05-09 10:42:03 -0400
committerBen Gamari <ben@smart-cactus.org>2018-06-04 21:26:59 -0400
commit14110449370a77195093dd3f610ab869ab9e36cf (patch)
tree713ea50ec8b150c3e5bc5508eb38619442640324 /haddock-api
parentf77c9c5cc8bb669f584d36494630589ea80eb799 (diff)
DerivingVia changes
Diffstat (limited to 'haddock-api')
-rw-r--r--haddock-api/src/Haddock/Interface/Rename.hs11
-rw-r--r--haddock-api/src/Haddock/Types.hs1
2 files changed, 10 insertions, 2 deletions
diff --git a/haddock-api/src/Haddock/Interface/Rename.hs b/haddock-api/src/Haddock/Interface/Rename.hs
index 14f2bfe2..e3e4e987 100644
--- a/haddock-api/src/Haddock/Interface/Rename.hs
+++ b/haddock-api/src/Haddock/Interface/Rename.hs
@@ -540,13 +540,20 @@ renameDerivD :: DerivDecl GhcRn -> RnM (DerivDecl DocNameI)
renameDerivD (DerivDecl { deriv_type = ty
, deriv_strategy = strat
, deriv_overlap_mode = omode }) = do
- ty' <- renameLSigWcType ty
+ ty' <- renameLSigWcType ty
+ strat' <- mapM (mapM renameDerivStrategy) strat
return (DerivDecl { deriv_ext = noExt
, deriv_type = ty'
- , deriv_strategy = strat
+ , deriv_strategy = strat'
, deriv_overlap_mode = omode })
renameDerivD (XDerivDecl _) = panic "haddock:renameDerivD"
+renameDerivStrategy :: DerivStrategy GhcRn -> RnM (DerivStrategy DocNameI)
+renameDerivStrategy StockStrategy = pure StockStrategy
+renameDerivStrategy AnyclassStrategy = pure AnyclassStrategy
+renameDerivStrategy NewtypeStrategy = pure NewtypeStrategy
+renameDerivStrategy (ViaStrategy ty) = ViaStrategy <$> renameLSigType ty
+
renameClsInstD :: ClsInstDecl GhcRn -> RnM (ClsInstDecl DocNameI)
renameClsInstD (ClsInstDecl { cid_overlap_mode = omode
, cid_poly_ty =ltype, cid_tyfam_insts = lATs
diff --git a/haddock-api/src/Haddock/Types.hs b/haddock-api/src/Haddock/Types.hs
index 444a1014..8e879cc8 100644
--- a/haddock-api/src/Haddock/Types.hs
+++ b/haddock-api/src/Haddock/Types.hs
@@ -710,6 +710,7 @@ type instance XCFamEqn DocNameI _ _ = NoExt
type instance XCClsInstDecl DocNameI = NoExt
type instance XCDerivDecl DocNameI = NoExt
+type instance XViaStrategy DocNameI = LHsSigType DocNameI
type instance XDataFamInstD DocNameI = NoExt
type instance XTyFamInstD DocNameI = NoExt
type instance XClsInstD DocNameI = NoExt