« first day (48 days earlier)      last day (332 days later) » 

4:07 PM
Well. (***) arrow is something like :: (a, b) -> (f a, g b). Are there some arrow with same function, like :: (a, b) -> (f a, f b)?
 
4:25 PM
@dmitrymalikov join (***) should do that.
3
 
@dmitrymalikov Hoogle time. Looks like there isn't.
 
@RMartinhoFernandes it works
 
5:24 PM
Thx hammar
 
6:17 PM
So how much of the following type is mutable STUArray s Int (UArray Int Int)
Hmm, I guess my question is what is the type of a mutable 2-d array
I am having trouble finding material explaining all this.
 
6:38 PM
@ExternalReality That's a mutable 1-d array of whose elements are mutable 1-d arrays
You want STUarray s (Int, Int) ElementType
The whole array package is a bit funny because of the index types. They confused me too at first. The idea is that all arrays ultimately have to be stored as sequential bytes, because the memory space is 1d. The Ix typeclass describes how this transformation is done. For Int, it's just a straightforward mapping. For tuples, it does the same coordinate trick (i*width+j) that you would have to do manually in C or C++
That's why all the array operations only take a single argument for the index, no matter what dimension you're working with
Of course, if you want an array of arrays (i.e. a jagged array), you'll have to nest them as you did. But note that the outer array cannot be an unboxed one, because an unboxed array can only hold elements of constant size.
 
7:01 PM
@hammar
well explained
thx
 

« first day (48 days earlier)      last day (332 days later) »