@@ -440,12 +440,22 @@ checkRec fa@(App _ _ _) fa'@(App _ _ _)
440440 (f', as') <- unApply fa'
441441 = if (length as /= length as')
442442 then checkRec f f'
443− else checkRecs (f : as) (f' : as')
443+ -- Same function but different args is recoverable,
444+ -- and vice versa, if it's an ordinary function
445+ -- If a constructor, everything has to be recoverable
446+ else do fok <- checkRec f f'
447+ argok <- checkRecs (f : as) (f : as')
448+ return (if conType f then fok && argok
449+ else fok || argok)
444450 where
445451 checkRecs [] [] = return True
446452 checkRecs (a : as) (b : bs) = do aok <- checkRec a b
447453 asok <- checkRecs as bs
448454 return (aok && asok)
455+ conType (P (DCon _ _ _) _ _) = True
456+ conType (P (TCon _ _) _ _) = True
457+ conType _ = False
458+
449459checkRec (P xt x _) (P yt y _)
450460 | x == y = return True
451461 | ntRec xt yt = return True