Repository : ssh://darcs.haskell.org//srv/darcs/haddock On branch : overlapping-tyfams
http://hackage.haskell.org/trac/ghc/changeset/8d3c11a3e9161738a701e4f870c973058fca913d >--------------------------------------------------------------- commit 8d3c11a3e9161738a701e4f870c973058fca913d Merge: aa9d6ce... a6ab966... Author: Richard Eisenberg <e...@cis.upenn.edu> Date: Fri Dec 21 19:16:10 2012 -0500 Merge branch 'master' into overlapping-tyfams Conflicts: src/Haddock/Convert.hs src/Haddock/Convert.hs | 24 ++++++++++++++---------- 1 files changed, 14 insertions(+), 10 deletions(-) diff --cc src/Haddock/Convert.hs index c522ed7,aca1218..8894793 --- a/src/Haddock/Convert.hs +++ b/src/Haddock/Convert.hs @@@ -91,23 -83,20 +91,24 @@@ synifyATDefault :: TyCon -> LTyFamInstD synifyATDefault tc = noLoc (synifyAxiom ax) where Just ax = tyConFamilyCoercion_maybe tc -synifyAxiom :: CoAxiom -> FamInstDecl Name -synifyAxiom (CoAxiom { co_ax_tvs = tkvs, co_ax_lhs = lhs, co_ax_rhs = rhs }) - | Just (tc, args) <- tcSplitTyConApp_maybe lhs - = let name = synifyName tc - typats = map (synifyType WithinType) args - hs_rhs_ty = synifyType WithinType rhs +synifyAxBranch :: TyCon -> CoAxBranch -> TyFamInstEqn Name - synifyAxBranch tc (CoAxBranch { cab_tvs = tvs, cab_lhs = args, cab_rhs = rhs }) - = let name = synifyName tc - typats = map (synifyType WithinType) args - hs_rhs = synifyType WithinType rhs ++synifyAxBranch tc (CoAxBranch { cab_tvs = tkvs, cab_lhs = args, cab_rhs = rhs }) ++ = let name = synifyName tc ++ typats = map (synifyType WithinType) args ++ hs_rhs = synifyType WithinType rhs + (kvs, tvs) = partition isKindVar tkvs - in FamInstDecl { fid_tycon = name - , fid_pats = HsWB { hswb_cts = typats - , hswb_kvs = map tyVarName kvs - , hswb_tvs = map tyVarName tvs } - , fid_defn = TySynonym hs_rhs_ty, fid_fvs = placeHolderNames } - | otherwise - = error "synifyAxiom" + in TyFamInstEqn { tfie_tycon = name + , tfie_pats = HsWB { hswb_cts = typats - , hswb_kvs = [] ++ , hswb_kvs = map tyVarName kvs + , hswb_tvs = map tyVarName tvs } + , tfie_rhs = hs_rhs } + +synifyAxiom :: CoAxiom br -> TyFamInstDecl Name +synifyAxiom (CoAxiom { co_ax_tc = tc, co_ax_branches = branches }) + = let eqns = brListMap (noLoc . synifyAxBranch tc) branches + in TyFamInstDecl { tfid_eqns = eqns + , tfid_group = (brListLength branches /= 1) + , tfid_fvs = placeHolderNames } synifyTyCon :: TyCon -> TyClDecl Name synifyTyCon tc _______________________________________________ Cvs-ghc mailing list Cvs-ghc@haskell.org http://www.haskell.org/mailman/listinfo/cvs-ghc