Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
Glasgow Haskell Compiler
GHC
Commits
e5beffb7
Commit
e5beffb7
authored
Mar 26, 2012
by
Simon Peyton Jones
Browse files
Complete refactoring of HsDecls/HsTyDefn
parent
d9ee9d9d
Changes
2
Hide whitespace changes
Inline
Side-by-side
compiler/main/HscStats.hs
View file @
e5beffb7
...
...
@@ -122,7 +122,7 @@ ppSourceStats short (L _ (HsModule _ exports imports ldecls _ _))
spec_info
(
Just
(
False
,
_
))
=
(
0
,
0
,
0
,
0
,
0
,
1
,
0
)
spec_info
(
Just
(
True
,
_
))
=
(
0
,
0
,
0
,
0
,
0
,
0
,
1
)
data_info
(
TyData
{
t
cdC
ons
=
cs
,
t
cdD
erivs
=
derivs
})
data_info
(
TyDecl
{
tcdTyDefn
=
TyData
{
t
d_c
ons
=
cs
,
t
d_d
erivs
=
derivs
}
}
)
=
(
length
cs
,
case
derivs
of
Nothing
->
0
Just
ds
->
length
ds
)
data_info
_
=
(
0
,
0
)
...
...
@@ -133,9 +133,9 @@ ppSourceStats short (L _ (HsModule _ exports imports ldecls _ _))
(
classops
,
addpr
(
foldr
add2
(
0
,
0
)
(
map
(
count_bind
.
unLoc
)
(
bagToList
(
tcdMeths
decl
)))))
class_info
_
=
(
0
,
0
)
inst_info
(
FamInstD
ecl
d
)
=
case
countATDecl
d
of
inst_info
(
FamInstD
d
)
=
case
countATDecl
d
of
(
tyd
,
dtd
)
->
(
0
,
0
,
0
,
tyd
,
dtd
)
inst_info
(
ClsInstD
ecl
_
inst_meths
inst_sigs
ats
)
inst_info
(
ClsInstD
_
inst_meths
inst_sigs
ats
)
=
case
count_sigs
(
map
unLoc
inst_sigs
)
of
(
_
,
_
,
ss
,
is
,
_
)
->
case
foldr
add2
(
0
,
0
)
(
map
(
countATDecl
.
unLoc
)
ats
)
of
...
...
@@ -144,10 +144,8 @@ ppSourceStats short (L _ (HsModule _ exports imports ldecls _ _))
(
map
(
count_bind
.
unLoc
)
(
bagToList
inst_meths
))),
ss
,
is
,
tyDecl
,
dtDecl
)
where
countATDecl
(
TyData
{})
=
(
0
,
1
)
countATDecl
(
TySynonym
{})
=
(
1
,
0
)
countATDecl
d
=
pprPanic
"countATDecl: Unhandled decl"
(
ppr
d
)
countATDecl
(
FamInstDecl
{
fid_defn
=
TyData
{}
})
=
(
0
,
1
)
countATDecl
(
FamInstDecl
{
fid_defn
=
TySynonym
{}
})
=
(
1
,
0
)
addpr
::
(
Int
,
Int
)
->
Int
add2
::
(
Int
,
Int
)
->
(
Int
,
Int
)
->
(
Int
,
Int
)
...
...
compiler/rename/RnTypes.lhs
View file @
e5beffb7
...
...
@@ -121,12 +121,13 @@ rnHsKind = rnHsTyKi False
rnHsTyKi :: Bool -> HsDocContext -> HsType RdrName -> RnM (HsType Name, FreeVars)
rnHsTyKi isType doc (HsForAllTy Implicit _ lctxt@(L
loc
ctxt) ty)
rnHsTyKi isType doc (HsForAllTy Implicit _ lctxt@(L
_
ctxt) ty)
= ASSERT ( isType ) do
-- Implicit quantifiction in source code (no kinds on tyvars)
-- Given the signature C => T we universally quantify
-- over FV(T) \ {in-scope-tyvars}
name_env <- getLocalRdrEnv
loc <- getSrcSpanM
let
mentioned = extractHsTysRdrTyVars (ty:ctxt)
...
...
Write
Preview
Supports
Markdown
0%
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!
Cancel
Please
register
or
sign in
to comment