[Haskell-cafe] dimension of arrays

Fred Nicolier f.nicolier at iut-troyes.univ-reims.fr
Mon Mar 29 11:33:30 EST 2004


Is there a way to get the number of dimension of an array ? i.e. 
something like :

 >dims :: (Ix a) => Array a b -> Int
 >dims = ...
 >a = listArray (1,10) [1,2..]
 >b = listArray ((1,1),(10,10)) [1,2..]
 >dims a -- should be equal to 1
 >dims b -- should be equal to 2

The key is somewhere in the Ix class but where ?

Fred



-- 
-------------------------------------------------------
Dr. Frederic Nicolier
Maitre de conferences, laboratoire LAM - URCA
Animateur du projet ANITA : http://f.nicolier.free.fr/recherches/
Dept. GE&II, IUT de Troyes
9 rue de Quebec
10026 Troyes Cedex
Tel: 03 25 42 71 01
Std: 03 25 42 46 46
Fax: 03 25 42 46 43
email: f.nicolier at iut-troyes.univ-reims.fr              
---------------------------------------------------------



More information about the Haskell-Cafe mailing list