From 6a8575c78baee0e16c612ddb6fb56267236fa743 Mon Sep 17 00:00:00 2001 From: simonmar Date: Thu, 25 Mar 2004 09:35:14 +0000 Subject: [haddock @ 2004-03-25 09:35:14 by simonmar] restrictTo: fix for restricting a newtype with a record field. --- src/HaddockUtil.hs | 5 +++-- 1 file 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 -- cgit v1.2.3