Marshall Multidimensional list, multidimensional array

Peter Simons simons at cryp.to
Wed Nov 10 11:57:39 EST 2004


glynn at gclements.plus.com writes:

 > To marshall a [[Int]] ...

 > 	withArray2D xs f = withArray (concat xs) f

 > 	withArray2D xs f = withArray xs' f
 > 		where	xs' = concat $ map (take dim) xs
 > 			dim = minimum $ map length xs

Um, I really wouldn't use the term "marshaling" when talking
about these functions because in the general case the result
of the first one will crash your process and the second one
loses data.

Peter


More information about the Glasgow-haskell-users mailing list