cc @hypercubestart after I land #6274 there is an issue where omitting a return type now causes inference to fail, when you work on mutual recursion can you look into this?
// (@jroesch): if we leave off the return type this doesn't work
/*
* Computes the sum of a list of integer scalars.
*/
// (@jroesch): if we leave off the return type this doesn't work
def @sum(%xs: List[Tensor[(), int32]]) -> int32 {
let %add_f = fn(%x: Tensor[(), int32], %y: Tensor[(), int32]) -> Tensor[(), int32] {
%x + %y
};
@foldl(%add_f, 0, %xs)
}
/*
* Computes the size of a tree.
*/
def @size[A](%t: Tree[A]) -> Tensor[(), int32] {
match(%t) {
Rose(_, %sub_trees) => {
1 + @sum(@map(@size, %sub_trees))
},
}
}