RosettaCodeData/Task/Identity-matrix/Haskell/identity-matrix-1.hs

2 lines
60 B
Haskell

matI n = [ [fromEnum $ i == j | i <- [1..n]] | j <- [1..n]]