@@ -51,7 +51,7 @@ mapSnd func (x, a) =
51-- CONVERT DEFINITIONS
51-- CONVERT DEFINITIONS
53detectTailRecursion :: Can.Def -> Opt.Def
53detectTailRecursion :: Can.Def -> Opt.Def
54−detectTailRecursion (Can.Definition _ pattern expression _) =
54+detectTailRecursion (Can.Definition canonFacts pattern expression _) =
56 (args, body) =
56 (args, body) =
57 Expr.collectLambdas expression
57 Expr.collectLambdas expression
@@ -71,9 +71,14 @@ detectTailRecursion (Can.Definition _ pattern expression _) =
72 lambda x e =
72 lambda x e =
73 A.A () (Lambda x e)
73 A.A () (Lambda x e)
77+ (if isTailCall then fmap fst context else Nothing)
78+ (Can.freeVariables canonFacts)
75 Opt.Definition
80 Opt.Definition
76− (Opt.Facts (if isTailCall then fmap fst context else Nothing))
81+ facts
77 (removeAnnotations pattern)
82 (removeAnnotations pattern)
78 (foldr lambda optExpr (map removeAnnotations args))
83 (foldr lambda optExpr (map removeAnnotations args))