Logo

Programming-Idioms

History of Idiom 26 > diff from v12 to v13

Edit summary for version 13 by :

Version 12

2015-09-04, 20:45:32

Version 13

2015-09-04, 20:46:01

Idiom #26 Create a 2-dimensional array

Declare and initialize a matrix x having m rows and n columns, containing real numbers.

Idiom #26 Create a 2-dimensional array

Declare and initialize a matrix x having m rows and n columns, containing real numbers.

Code
x = [ [ j**(1/i) | j <- [1..n] ] | i <- [1..m] ]
Code
x = [ [ j**(1/i) | j <- [1..n] ] | i <- [1..m] ]
Comments bubble
read no need to cast this through (Data.Array.listArray ((1,1),(m,n)))