Skip to content
GitLab
Menu
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
fea9a757
Commit
fea9a757
authored
May 16, 2017
by
Simon Peyton Jones
Browse files
Tiny refactor
parent
2c21d74c
Changes
1
Hide whitespace changes
Inline
Side-by-side
compiler/typecheck/TcInteract.hs
View file @
fea9a757
...
...
@@ -1739,17 +1739,21 @@ improve_top_fun_eqs fam_envs fam_tc args rhs_ty
-- see Note [Type inference for type families with injectivity]
|
isOpenTypeFamilyTyCon
fam_tc
,
Injective
injective_args
<-
familyTyConInjectivityInfo
fam_tc
,
let
fam_insts
=
lookupFamInstEnvByTyCon
fam_envs
fam_tc
=
-- it is possible to have several compatible equations in an open type
-- family but we only want to derive equalities from one such equation.
concatMapM
(
injImproveEqns
injective_args
)
(
take
1
$
buildImprovementData
(
lookupFamInstEnvByTyCon
fam_envs
fam_tc
)
fi_tvs
fi_tys
fi_rhs
(
const
Nothing
))
do
{
let
improvs
=
buildImprovementData
fam_insts
fi_tvs
fi_tys
fi_rhs
(
const
Nothing
)
;
traceTcS
"improve_top_fun_eqs2"
(
ppr
improvs
)
;
concatMapM
(
injImproveEqns
injective_args
)
$
take
1
improvs
}
|
Just
ax
<-
isClosedSynFamilyTyConWithAxiom_maybe
fam_tc
,
Injective
injective_args
<-
familyTyConInjectivityInfo
fam_tc
=
concatMapM
(
injImproveEqns
injective_args
)
$
buildImprovementData
(
fromBranches
(
co_ax_branches
ax
))
cab_tvs
cab_lhs
cab_rhs
Just
buildImprovementData
(
fromBranches
(
co_ax_branches
ax
))
cab_tvs
cab_lhs
cab_rhs
Just
|
otherwise
=
return
[]
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a 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