fork(1) download
  1.  
  2. diag2 ys =
  3. nx (reverse ys)
  4. where
  5. nx ((x : _) : xs) = x : nx (map tail xs)
  6. nx _ = []
  7.  
  8. main = do
  9. let xs = diag2 [[1,1,3],[1,3,1],[3,1,1]]
  10. putStr (show xs)
Success #stdin #stdout 0s 6268KB
stdin
Standard input is empty
stdout
[3,3,3]