Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
G
gargantext-ihaskell
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
gargantext
gargantext-ihaskell
Commits
9f157b36
Commit
9f157b36
authored
Mar 05, 2015
by
Andrew Gibiansky
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Make sure to check class name when filtering instances
parent
0c87254e
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
3 deletions
+3
-3
Util.hs
src/IHaskell/Eval/Util.hs
+3
-3
No files found.
src/IHaskell/Eval/Util.hs
View file @
9f157b36
...
...
@@ -313,7 +313,7 @@ evalDeclarations decl = do
cleanUpDuplicateInstances
::
GhcMonad
m
=>
m
()
cleanUpDuplicateInstances
=
modifySession
$
\
hscEnv
->
let
-- Get all class instances
j
-- Get all class instances
ic
=
hsc_IC
hscEnv
(
clsInsts
,
famInsts
)
=
ic_instances
ic
-- Remove duplicates
...
...
@@ -321,11 +321,11 @@ cleanUpDuplicateInstances = modifySession $ \hscEnv ->
in
hscEnv
{
hsc_IC
=
ic
{
ic_instances
=
(
clsInsts'
,
famInsts
)
}
}
where
instEq
::
ClsInst
->
ClsInst
->
Bool
instEq
ClsInst
{
is_tvs
=
tpl_tvs
,
is_tys
=
tpl_tys
}
ClsInst
{
is_tys
=
tpl_ty
s'
}
=
instEq
ClsInst
{
is_tvs
=
tpl_tvs
,
is_tys
=
tpl_tys
,
is_cls
=
cls
}
ClsInst
{
is_tys
=
tpl_tys'
,
is_cls
=
cl
s'
}
=
#
if
MIN_VERSION_ghc
(
7
,
8
,
0
)
-- Only support replacing instances on GHC 7.8 and up
let
tpl_tv_set
=
mkVarSet
tpl_tvs
in
isJust
$
tcMatchTys
tpl_tv_set
tpl_tys
tpl_tys'
in
cls
==
cls'
&&
isJust
(
tcMatchTys
tpl_tv_set
tpl_tys
tpl_tys'
)
#
else
False
#
endif
...
...
Write
Preview
Markdown
is supported
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