
Sjoerd Visscher wrote:
I believe this does what you want:
<code>
The attached code should be more efficient, since it doesn't use integer indices. Note that this is just a 'level' monad: the list is stratified into levels, when combining two levels, the level of the result is the sum of the levels of the inputs. map (map sum) . runDiags . traverse each $ [[1..], [1..], [1..]] [[3],[4,4,4],[5,5,5,5,5,5],[6,6,6,6,6,6,6,6,6,6],[7,7,7,7,7,7,7,7,7,7,7,... I looked on hackage but I was surprised that I couldn't find this simple monad. The package level-monad does look very similar, only it uses a different list type for the representation. By the way, it seems Omega intentionally doesn't use this design. To quote the documentation "... a breadth-first search of a data structure can fall short if it has an infinitely branching node. Omega addresses this problem ..." Twan