@@ -101,10 +101,7 @@ elab ist info pattern tcgen fn tm
101101 (elab' ina (PRef fc unitTy))
102102 elab' ina (PFalse fc) = elab' ina (PRef fc falseTy)
103103 elab' ina (PResolveTC (FC "HACK" _)) -- for chasing parent classes
104− = do t <- goal
105− -- let insts = filter tcname $ map fst (ctxtAlist (tt_ctxt ist))
106− let insts = findInstances ist t
107− resolveTC 2 fn insts ist
104+ = resolveTC 2 fn ist
108105 elab' ina (PResolveTC fc) = do c <- unique_hole (MN 0 "c")
109106 instanceArg c
110107 elab' ina (PRefl fc) = elab' ina (PApp fc (PRef fc eqCon) [pimp (MN 0 "a") Placeholder,
@@ -240,9 +237,7 @@ elab ist info pattern tcgen fn tm
240237 when (not pattern || (ina && not tcgen)) $
241238 mapM_ (\n -> do focus n
242239 -- let insts = filter tcname $ map fst (ctxtAlist (tt_ctxt ist))
243− t <- goal
244− let insts = findInstances ist t
245− resolveTC 7 fn insts ist) (ivs' \\ ivs)
240+ resolveTC 7 fn ist) (ivs' \\ ivs)
246241 where tcArg (n, PConstraint _ _ Placeholder) = True
247242 tcArg _ = False
248243
@@ -359,12 +354,13 @@ findInstances ist t
359354 _ -> []
360355 | otherwise = []
361356
362−resolveTC :: Int -> Name -> [Name] -> IState -> ElabD ()
363−resolveTC 0 fn insts ist = fail $ "Can't resolve type class"
364−resolveTC 1 fn insts ist = try (trivial ist) (resolveTC 0 fn insts ist)
365−resolveTC depth fn insts ist
357+resolveTC :: Int -> Name -> IState -> ElabD ()
358+resolveTC 0 fn ist = fail $ "Can't resolve type class"
359+resolveTC 1 fn ist = try (trivial ist) (resolveTC 0 fn ist)
360+resolveTC depth fn ist
366361 = try (trivial ist)
367362 (do t <- goal
363+ let insts = findInstances ist t
368364 let (tc, ttypes) = unApply t
369365 scopeOnly <- needsDefault t tc ttypes
370366 tm <- get_term
@@ -376,11 +372,11 @@ resolveTC depth fn insts ist
376372 elabTC n | n /= fn && tcname n = (resolve n depth, show n)
377373 | otherwise = (fail "Can't resolve", show n)
378374
379− needsDefault t num@(P _ (NS (UN "Num") ["builtins"]) _) [P Bound a _]
380− = do focus a
381− fill (RConstant IType) -- default Int
382− solve
383− return False
375+-- needsDefault t num@(P _ (NS (UN "Num") ["builtins"]) _) [P Bound a _]
376+-- = do focus a
377+-- fill (RConstant IType) -- default Int
378+-- solve
379+-- return False
384380 needsDefault t f as
385381 | all boundVar as = return True -- fail $ "Can't resolve " ++ show t
386382 needsDefault t f a = return False -- trace (show t) $ return ()
@@ -408,7 +404,7 @@ resolveTC depth fn insts ist
408404 args <- apply (Var n) imps
409405-- traceWhen (all boundVar ttypes) ("Progress: " ++ show t ++ " with " ++ show n) $
410406 mapM_ (\ (_,n) -> do focus n
411− resolveTC (depth - 1) fn insts ist)
407+ resolveTC (depth - 1) fn ist)
412408 (filter (\ (x, y) -> not x) (zip (map fst imps) args))
413409 -- if there's any arguments left, we've failed to resolve
414410 solve