Open jiaminglu opened 5 years ago
Here is an analogous Coq function that is considered total:
From Coq Require Import List.
Inductive Tree :=
Branches : list Tree -> Tree | Node : nat -> Tree.
Definition sum (xs : list nat) := fold_right plus 0 xs.
Fixpoint sumTree (t : Tree) : nat :=
match t with
| Branches xs => sum (map sumTree xs)
| Node x => x
end.
Idris version: 1.3.1
Steps to Reproduce
For example, I have the following code:
If I want it pass the totality check, I have to expand map manually:
Which makes a lot of power of functional programming not available.
Expected Behavior
The totality should check.
Observed Behavior
It's not.