
10 Nov
2004
10 Nov
'04
11:57 a.m.
glynn@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