From 26a590c009005d77fbee9e2c79286bd93f7955f5 Mon Sep 17 00:00:00 2001 From: Adam Gundry Date: Mon, 4 May 2015 15:32:59 +0100 Subject: Track API changes to support empty closed type familes --- haddock-api/src/Haddock/Convert.hs | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) (limited to 'haddock-api/src/Haddock/Convert.hs') diff --git a/haddock-api/src/Haddock/Convert.hs b/haddock-api/src/Haddock/Convert.hs index ce1ef8b6..d841aecc 100644 --- a/haddock-api/src/Haddock/Convert.hs +++ b/haddock-api/src/Haddock/Convert.hs @@ -131,7 +131,7 @@ synifyAxiom ax@(CoAxiom { co_ax_tc = tc }) (TyFamInstDecl { tfid_eqn = noLoc $ synifyAxBranch tc branch , tfid_fvs = placeHolderNamesTc })) - | Just ax' <- isClosedSynFamilyTyCon_maybe tc + | Just ax' <- isClosedSynFamilyTyConWithAxiom_maybe tc , getUnique ax' == getUnique ax -- without the getUniques, type error = synifyTyCon (Just ax) tc >>= return . TyClD @@ -168,11 +168,15 @@ synifyTyCon coax tc Just rhs -> let info = case rhs of OpenSynFamilyTyCon -> return OpenTypeFamily - ClosedSynFamilyTyCon (CoAxiom { co_ax_branches = branches }) -> - return $ ClosedTypeFamily - (brListMap (noLoc . synifyAxBranch tc) branches) - BuiltInSynFamTyCon {} -> return $ ClosedTypeFamily [] - AbstractClosedSynFamilyTyCon {} -> return $ ClosedTypeFamily [] + ClosedSynFamilyTyCon mb -> case mb of + Just (CoAxiom { co_ax_branches = branches }) + -> return $ ClosedTypeFamily $ Just $ + brListMap (noLoc . synifyAxBranch tc) branches + Nothing -> return $ ClosedTypeFamily $ Just [] + BuiltInSynFamTyCon {} + -> return $ ClosedTypeFamily $ Just [] + AbstractClosedSynFamilyTyCon {} + -> return $ ClosedTypeFamily Nothing in info >>= \i -> return (FamDecl (FamilyDecl { fdInfo = i -- cgit v1.2.3