aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/HaddockUtil.hs5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/HaddockUtil.hs b/src/HaddockUtil.hs
index a4248e81..ce22ee24 100644
--- a/src/HaddockUtil.hs
+++ b/src/HaddockUtil.hs
@@ -140,8 +140,9 @@ restrictTo names decl = case decl of
HsDataDecl loc ctxt n xs (restrictCons names cons) drv doc
decl@(HsNewTypeDecl loc ctxt n xs con drv doc) ->
case restrictCons names [con] of
- [] -> HsDataDecl loc ctxt n xs [] drv doc
- _ -> decl
+ [] -> HsDataDecl loc ctxt n xs [] drv doc
+ [con'] -> HsNewTypeDecl loc ctxt n xs con' drv doc
+ -- an abstract newtype decl appears as a data decl.
HsClassDecl loc ctxt n tys fds decls doc ->
HsClassDecl loc ctxt n tys fds (restrictDecls names decls) doc
_ -> decl