[commit: haddock] master: Merge branch 'no-pred-ty' (2fed1c8)
Max Bolingbroke
batterseapower at hotmail.com
Fri Sep 9 15:40:52 CEST 2011
Repository : ssh://darcs.haskell.org//srv/darcs/haddock
On branch : master
http://hackage.haskell.org/trac/ghc/changeset/2fed1c8a1dd4ce5713dde980b3a6f717ea6d6d5e
>---------------------------------------------------------------
commit 2fed1c8a1dd4ce5713dde980b3a6f717ea6d6d5e
Merge: 0f21c47... 7082a7c...
Author: Max Bolingbroke <batterseapower at hotmail.com>
Date: Fri Sep 9 13:34:29 2011 +0100
Merge branch 'no-pred-ty'
Conflicts:
src/Haddock/Convert.hs
src/Haddock/Backends/Hoogle.hs | 4 +-
src/Haddock/Backends/LaTeX.hs | 31 +++++------
src/Haddock/Backends/Xhtml/Decl.hs | 32 +++++------
src/Haddock/Convert.hs | 86 +++++++++++++-----------------
src/Haddock/Interface/AttachInstances.hs | 2 -
src/Haddock/Interface/Create.hs | 2 +-
src/Haddock/Interface/Rename.hs | 31 ++---------
src/Haddock/Types.hs | 2 +-
8 files changed, 75 insertions(+), 115 deletions(-)
diff --cc src/Haddock/Convert.hs
index 81435a6,b3549fd..d4f7566
--- a/src/Haddock/Convert.hs
+++ b/src/Haddock/Convert.hs
@@@ -47,7 -49,22 +49,24 @@@ tyThingToLHsDecl t = noLoc $ case t o
-- type-constructors (e.g. Maybe) are complicated, put the definition
-- later in the file (also it's used for class associated-types too.)
- ATyCon tc -> TyClD (synifyTyCon tc)
+ ATyCon tc
+ | Just cl <- tyConClass_maybe tc -- classes are just a little tedious
+ -> TyClD $ ClassDecl
+ (synifyCtx (classSCTheta cl))
+ (synifyName cl)
+ (synifyTyVars (classTyVars cl))
+ (map (\ (l,r) -> noLoc
+ (map getName l, map getName r) ) $
+ snd $ classTvsFds cl)
+ (map (noLoc . synifyIdSig DeleteTopLevelQuantification)
+ (classMethods cl))
+ emptyBag --ignore default method definitions, they don't affect signature
- (map synifyClassAT (classATs cl))
++ -- class associated-types are a subset of TyCon:
++ [noLoc (synifyTyCon at_tc) | (at_tc, _) <- classATItems cl]
++ [] --ignore associated type defaults
+ [] --we don't have any docs at this point
+ | otherwise
+ -> TyClD (synifyTyCon tc)
-- type-constructors (e.g. Maybe) are complicated, put the definition
-- later in the file (also it's used for class associated-types too.)
@@@ -56,33 -73,12 +75,10 @@@
-- a data-constructor alone just gets rendered as a function:
ADataCon dc -> SigD (TypeSig [synifyName dc]
(synifyType ImplicitizeForAll (dataConUserType dc)))
- -- classes are just a little tedious
- AClass cl ->
- TyClD $ ClassDecl
- (synifyCtx (classSCTheta cl))
- (synifyName cl)
- (synifyTyVars (classTyVars cl))
- (map (\ (l,r) -> noLoc
- (map getName l, map getName r) ) $
- snd $ classTvsFds cl)
- (map (noLoc . synifyIdSig DeleteTopLevelQuantification)
- (classMethods cl))
- emptyBag --ignore default method definitions, they don't affect signature
- ats
- (concat at_defss)
- [] --we don't have any docs at this point
- where (ats, at_defss) = unzip $ map synifyClassAT (classATItems cl)
-
-
- -- class associated-types are a subset of TyCon
- -- (mainly only type/data-families)
- synifyClassAT :: ClassATItem -> (LTyClDecl Name, [LTyClDecl Name])
- synifyClassAT (tc, _mb_defs) = (noLoc (synifyTyCon tc), [])
- -- ignore the mb_defs since we ignore default methods
-
--- class associated-types are a subset of TyCon
--- (mainly only type/data-families)
-synifyClassAT :: TyCon -> LTyClDecl Name
-synifyClassAT = noLoc . synifyTyCon
+synifyATDefault :: TyCon -> LTyClDecl Name
+synifyATDefault tc = noLoc (synifyAxiom ax)
+ where Just ax = tyConFamilyCoercion_maybe tc
synifyAxiom :: CoAxiom -> TyClDecl Name
synifyAxiom (CoAxiom { co_ax_tvs = tvs, co_ax_lhs = lhs, co_ax_rhs = rhs })
More information about the Cvs-ghc
mailing list