diff options
author | David Waern <david.waern@gmail.com> | 2008-07-20 11:21:46 +0000 |
---|---|---|
committer | David Waern <david.waern@gmail.com> | 2008-07-20 11:21:46 +0000 |
commit | 9f215339900126328ccbdef6527634c34f44d56b (patch) | |
tree | b99a7a8ee4766e0dca86bd2b4153fc838374aeb6 /src/Haddock/Interface/AttachInstances.hs | |
parent | b888192534c7c070647755f1778fa5a55002d87f (diff) |
Preparation for rendering instances as separate declarations
We want to be able to render instances as separate declarations. So we remove
the Name argument of ExportDecl, since instances are nameless.
This patch also contains the first steps needed to gather type family instances
and display them in the backend, but the implementation is far from complete.
Because of this, we don't actually show the instances yet.
Diffstat (limited to 'src/Haddock/Interface/AttachInstances.hs')
-rw-r--r-- | src/Haddock/Interface/AttachInstances.hs | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/src/Haddock/Interface/AttachInstances.hs b/src/Haddock/Interface/AttachInstances.hs index aed832bb..38fef6b4 100644 --- a/src/Haddock/Interface/AttachInstances.hs +++ b/src/Haddock/Interface/AttachInstances.hs @@ -43,11 +43,12 @@ attachInstances modules filterNames = map attach modules where newItems = map attachExport (ifaceExportItems mod) - attachExport (ExportDecl n decl doc _) = - ExportDecl n decl doc (case Map.lookup n instMap of - Nothing -> [] - Just instheads -> instheads) - attachExport otherExport = otherExport + attachExport (ExportDecl decl@(L _ (TyClD d)) doc _) + | isClassDecl d || isDataDecl d || isFamilyDecl d = + ExportDecl decl doc (case Map.lookup (tcdName d) instMap of + Nothing -> [] + Just instheads -> instheads) + attachExport export = export -------------------------------------------------------------------------------- |