@@ -615,9 +615,11 @@ resolveTC depth fn ist
615615 if True -- all (\n -> not (n `elem` hs)) (freeNames g)
616616 then try' (trivial ist)
617617 (do t <- goal
618− let insts = findInstances ist t
619618 let (tc, ttypes) = unApply t
620619 scopeOnly <- needsDefault t tc ttypes
620+ let insts_in = findInstances ist t
621+ let insts = if scopeOnly then filter chaser insts_in
622+ else insts_in
621623 tm <- get_term
622624-- traceWhen (depth > 6) ("GOAL: " ++ show t ++ "\nTERM: " ++ show tm) $
623625-- (tryAll (map elabTC (map fst (ctxtAlist (tt_ctxt ist)))))
@@ -633,6 +635,12 @@ resolveTC depth fn ist
633635 elabTC n | n /= fn && tcname n = (resolve n depth, show n)
634636 | otherwise = (fail "Can't resolve", show n)
635637
638+ -- HACK! Rather than giving a special name, better to have some kind
639+ -- of flag in ClassInfo structure
640+ chaser (UN ('@':'@':_)) = True
641+ chaser (NS n _) = chaser n
642+ chaser _ = False
643+
636644 needsDefault t num@(P _ (NS (UN "Num") ["Builtins"]) _) [P Bound a _]
637645 = do focus a
638646 fill (RConstant IType) -- default Int