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
f6b98ea7
Commit
f6b98ea7
authored
Feb 15, 2016
by
Simon Peyton Jones
Browse files
Tiny refactor; use guards instead of 'if'
parent
160765f8
Changes
1
Hide whitespace changes
Inline
Side-by-side
compiler/types/Type.hs
View file @
f6b98ea7
...
...
@@ -1237,13 +1237,13 @@ mkPiTypesPreferFunTy :: [TyVar] -> Type -> Type
mkPiTypesPreferFunTy
vars
inner_ty
=
fst
$
go
vars
inner_ty
where
go
::
[
TyVar
]
->
Type
->
(
Type
,
VarSet
)
-- also returns the free vars
go
[]
ty
=
(
ty
,
tyCoVarsOfType
ty
)
go
(
v
:
vs
)
ty
=
if
v
`
elemVarSet
`
fvs
then
(
mkForAllTy
(
Named
v
Visible
)
qty
,
fvs
`
delVarSet
`
v
`
unionVarSet
`
kind_vars
)
else
(
mkForAllTy
(
Anon
(
tyVarKind
v
))
qty
,
fvs
`
unionVarSet
`
kind_vars
)
go
[]
ty
=
(
ty
,
tyCoVarsOfType
ty
)
go
(
v
:
vs
)
ty
|
v
`
elemVarSet
`
fvs
=
(
mkForAllTy
(
Named
v
Visible
)
qty
,
fvs
`
delVarSet
`
v
`
unionVarSet
`
kind_vars
)
|
otherwise
=
(
mkForAllTy
(
Anon
(
tyVarKind
v
))
qty
,
fvs
`
unionVarSet
`
kind_vars
)
where
(
qty
,
fvs
)
=
go
vs
ty
kind_vars
=
tyCoVarsOfType
$
tyVarKind
v
...
...
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