Re:Exotic List Monads
by 082349872349872 on Friday January 08, 2021 @12:47AM
(#25681901)
for finite lists, why not just have it return in k-diagonal order? (sort of like Hope's "diagonal comprehension" but with wraparound repetition)
The "diagonal" monad join [[a, b, c, ...], [1, 2, 3, ...], [x, y, z, ...], ...] = [a, 2, z, ...] has return a = [a, a, a, ...], though I guess it's hard to define it in a way that's well-behaved for finite lists, so you might not consider it "a monad on lists".