From a2bcbcffde1e78a6031132bdf4a1a605978352a8 Mon Sep 17 00:00:00 2001 From: Henning Thielemann Date: Sun, 1 Apr 2012 13:03:07 +0200 Subject: add QualOption type for distinction between qualification argument given by the user and the actual qualification for a concrete module --- src/Haddock/Backends/Xhtml/Names.hs | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) (limited to 'src/Haddock/Backends/Xhtml/Names.hs') diff --git a/src/Haddock/Backends/Xhtml/Names.hs b/src/Haddock/Backends/Xhtml/Names.hs index 274078a6..9963fffc 100644 --- a/src/Haddock/Backends/Xhtml/Names.hs +++ b/src/Haddock/Backends/Xhtml/Names.hs @@ -64,14 +64,10 @@ ppQualifyName qual name mdl = case qual of NoQual -> ppName name FullQual -> ppFullQualName mdl name - -- this is just in case, it should never happen - LocalQual Nothing -> ppQualifyName FullQual name mdl - LocalQual (Just localmdl) + LocalQual localmdl | moduleString mdl == moduleString localmdl -> ppName name | otherwise -> ppFullQualName mdl name - -- again, this never happens - RelativeQual Nothing -> ppQualifyName FullQual name mdl - RelativeQual (Just localmdl) -> + RelativeQual localmdl -> case List.stripPrefix (moduleString localmdl) (moduleString mdl) of -- local, A.x -> x Just [] -> ppQualifyName NoQual name mdl -- cgit v1.2.3