Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
H
haddock
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Apoorv Ingle
haddock
Commits
20c4bfe7
Commit
20c4bfe7
authored
13 years ago
by
waern
Browse files
Options
Downloads
Patches
Plain Diff
Cleanup.
parent
0d7f4dfb
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/Haddock/Interface/Create.hs
+11
-27
11 additions, 27 deletions
src/Haddock/Interface/Create.hs
with
11 additions
and
27 deletions
src/Haddock/Interface/Create.hs
+
11
−
27
View file @
20c4bfe7
...
...
@@ -212,19 +212,6 @@ declInfos dflags gre decls =
return
(
parent
,
(
mbDoc
,
fnArgsDoc
),
subs
)
-- | If you know the HsDecl can't contain any docs
-- (e.g., it was loaded from a .hi file and you don't have a .haddock file
-- to help you find out about the subs or docs)
-- then you can use this to get its subs.
subordinatesWithNoDocs
::
HsDecl
Name
->
[(
Name
,
DocForDecl
Name
)]
subordinatesWithNoDocs
decl
=
map
noDocs
(
subordinates
decl
)
where
-- check the condition... or shouldn't we be checking?
noDocs
(
n
,
doc1
,
doc2
)
|
null
doc1
,
Map
.
null
doc2
=
(
n
,
noDocForDecl
)
noDocs
_
=
error
(
"no-docs thing has docs! "
++
pretty
decl
)
subordinates
::
HsDecl
Name
->
[(
Name
,
MaybeDocStrings
,
Map
Int
HsDocString
)]
subordinates
(
TyClD
d
)
=
classDataSubs
d
subordinates
_
=
[]
...
...
@@ -254,31 +241,28 @@ classDataSubs decl
,
ConDeclField
n
_
doc
<-
flds
]
-- All the sub declarations of a class (that we handle), ordered by
--
|
All the sub declarations of a class (that we handle), ordered by
-- source location, with documentation attached if it exists.
classDecls
::
TyClDecl
Name
->
[(
Decl
,
MaybeDocStrings
)]
classDecls
=
filterDecls
.
collectDocs
.
sortByLoc
.
declsFromClass
declsFromClass
::
TyClDecl
a
->
[
Located
(
HsDecl
a
)]
declsFromClass
class_
=
docs
++
defs
++
sigs
++
ats
classDecls
class_
=
filterDecls
.
collectDocs
.
sortByLoc
$
decls
where
docs
=
mkDecls
tcdDocs
DocD
class_
defs
=
mkDecls
(
bagToList
.
tcdMeths
)
ValD
class_
sigs
=
mkDecls
tcdSigs
SigD
class_
ats
=
mkDecls
tcdATs
TyClD
class_
decls
=
docs
++
defs
++
sigs
++
ats
docs
=
mkDecls
tcdDocs
DocD
class_
defs
=
mkDecls
(
bagToList
.
tcdMeths
)
ValD
class_
sigs
=
mkDecls
tcdSigs
SigD
class_
ats
=
mkDecls
tcdATs
TyClD
class_
-- | The top-level declarations of a module that we care about,
-- ordered by source location, with documentation attached if it exists.
topDecls
::
HsGroup
Name
->
[(
Decl
,
MaybeDocStrings
)]
topDecls
=
filterClasses
.
filterDecls
.
collectDocs
.
sortByLoc
.
declsFromG
roup
topDecls
=
filterClasses
.
filterDecls
.
collectDocs
.
sortByLoc
.
ung
roup
-- | Take all declarations except pragmas, infix decls, rules and value
-- bindings from an 'HsGroup'.
declsFromG
roup
::
HsGroup
Name
->
[
Decl
]
declsFromG
roup
group_
=
ung
roup
::
HsGroup
Name
->
[
Decl
]
ung
roup
group_
=
mkDecls
(
concat
.
hs_tyclds
)
TyClD
group_
++
mkDecls
hs_derivds
DerivD
group_
++
mkDecls
hs_defds
DefD
group_
++
...
...
@@ -546,7 +530,7 @@ mkExportItems modMap thisMod gre exportedNames decls declMap
Nothing
->
do
liftErrMsg
$
tell
[
"Warning: Couldn't find .haddock for export "
++
pretty
t
]
let
subs
=
subordinates
WithNoDocs
(
unLoc
decl
)
let
subs
=
[
(
n
,
noDocForDecl
)
|
(
n
,
_
,
_
)
<-
subordinates
(
unLoc
decl
)
]
return
[
mkExportDecl
t
(
decl
,
noDocForDecl
,
subs
)
]
Just
iface
->
do
let
subs
=
case
Map
.
lookup
t
(
instSubMap
iface
)
of
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment