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
e83fa2eb
Commit
e83fa2eb
authored
Feb 20, 2003
by
simonpj
Browse files
[project @ 2003-02-20 16:02:57 by simonpj]
Add comments
parent
3194c528
Changes
1
Hide whitespace changes
Inline
Side-by-side
ghc/compiler/typecheck/TcInstDcls.lhs
View file @
e83fa2eb
...
...
@@ -629,6 +629,18 @@ tcMethods clas inst_tyvars inst_tyvars' dfun_theta' inst_tys'
--
-- Solution: make meth_insts available, so that 'then' refers directly
-- to the local 'bind' rather than going via the dictionary.
--
-- BUT WATCH OUT! If the method type mentions the class variable, then
-- this optimisation is not right. Consider
-- class C a where
-- op :: Eq a => a
--
-- instance C Int where
-- op = op
-- The occurrence of 'op' on the rhs gives rise to a constraint
-- op at Int
-- The trouble is that the 'meth_inst' for op, which is 'available', also
-- looks like 'op at Int'. But they are not the same.
let
all_insts = avail_insts ++ catMaybes meth_insts
xtve = inst_tyvars `zip` inst_tyvars'
...
...
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