This output has a too much rightward drift in the first branch:
fun filterIdx p s =
case s of
Flat (Full slice) =>
Flat
(Full
(AS.full
(SeqBasis.filter gran (0, AS.length slice) (AS.nth slice)
(fn k => p (k, AS.nth slice k)))))
| Flat (Delay (i, j, f)) =>
Flat (Full (AS.full (SeqBasis.filter gran (i, j) f (fn k => p (k, f k)))))
| _ => filterIdx p (force s)
If we increase the max width to 100, it becomes more reasonable again:
fun filterIdx p s =
case s of
Flat (Full slice) =>
Flat (Full (AS.full (SeqBasis.filter gran (0, AS.length slice) (AS.nth slice) (fn k =>
p (k, AS.nth slice k)))))
| Flat (Delay (i, j, f)) =>
Flat (Full (AS.full (SeqBasis.filter gran (i, j) f (fn k => p (k, f k)))))
| _ => filterIdx p (force s)
To fix this, I think "splittable expressions" need to be generalized to handle multiple possible splits...
This output has a too much rightward drift in the first branch:
If we increase the max width to 100, it becomes more reasonable again:
To fix this, I think "splittable expressions" need to be generalized to handle multiple possible splits...