on master help sign in
Efficiency of unification

Unification is trying to hard to unify things which are never going to work, and backtracking a lot. This stops that. Fixes #1219

commitf01c1a1d197f1a3de0db66aeee442ca605bee980 authorEdwin Brady <ecb10@st-andrews.ac.uk> dateMon 8 Dec 2014, 12:51 (12 years ago) parent6b13474
1 file changed+4
src/Idris/Core/Unify.hs+4
src/Idris/Core/Unify.hs+4
@@ -454,6 +454,10 @@ unify ctxt env topx topy inj holes usersupp from =
454454 return [] -- lift $ tfail err
455455
456456 unApp fn bnames appx@(App fx ax) appy@(App fy ay)
457+ -- shortcut for the common case where we just want to check the
458+ -- arguments are correct
459+ | (injectiveApp fx && fx == fy)
460+ = un' False bnames ax ay
457461 | (injectiveApp fx && injectiveApp fy)
458462 || (injectiveApp fx && metavarApp fy && ax == ay)
459463 || (injectiveApp fy && metavarApp fx && ax == ay)