1
1
mirror of https://github.com/anoma/juvix.git synced 2024-12-15 01:52:11 +03:00
juvix/tests/positive/Termination/Data/Tree.mjuvix
2022-04-04 17:44:08 +02:00

16 lines
342 B
Plaintext

module Data.Tree;
inductive Tree (A : Type) {
leaf : Tree A;
branch : Tree A → Tree A → Tree A;
};
f : (A : Type) → Tree A → Tree A → Tree A;
f A x leaf := x;
f A x (branch y z) := f A (f A x y) z;
g : (A : Type) → Tree A → Tree A → Tree A;
g A x leaf := x;
g A x (branch y z) := g A z (g A x y);
end;