Fold does not play nicely with type patterns
It seems we have a problem when combining fold and type patterns.
The following fails
int[n] minsl1(int[n,m] arr)
{
return with {
([0] <= iv < [n]) : arr[iv];
} : fold(ArrayArith::min, genarray([m], Constants::maxint()));
}
int[m] minv(int[m] a, int[m] b)
{
return _min_VxV_(a, b);
}
No definition found for a function "ArrayFormat::minv" that accepts an argument
of type "int[.]" as parameter no 1. Full argument types are "( int[.], int[.])".
Removing the type patterns makes it work again:
int[n] minsl1(int[n,m] arr)
{
return with {
([0] <= iv < [n]) : arr[iv];
} : fold(minv, genarray([m], Constants::maxint()));
}
int[.] minv(int[.] a, int[.] b)
{
return _min_VxV_(a, b);
}