definition: |
diagonal :: [[a]] -> [a] diagonal = concat . foldr diags [] where diags [] ys = ys diags (x:xs) ys = [x] : merge' xs ys merge' [] ys = ys merge' xs@(_:_) [] = map (:[]) xs merge' (x:xs) (y:ys) = (x:y) : merge' xs ys |
demand: |
no demanded arguments |
deterministic: |
deterministic operation |
documentation: |
Diagonalization of a list of lists. Fairly merges (possibly infinite) list of (possibly infinite) lists. @param xss - lists of lists @return fair enumeration of all elements of inner lists of given lists |
failfree: |
() |
indeterministic: |
referentially transparent operation |
infix: |
no fixity defined |
iotype: |
{() |-> {.._#lambda508}} |
name: |
diagonal |
precedence: |
no precedence defined |
result-values: |
{.._#lambda508} |
signature: |
[[a]] -> [a] |
solution-complete: |
operation might suspend on free variables |
terminating: |
yes |
totally-defined: |
reducible on all ground data terms |