[Haskell-cafe] Unboxed arrays

Roman Cheplyaka roma at ro-che.info
Wed Mar 26 09:04:43 EDT 2008

* Andrew Coppin <andrewcoppin at btinternet.com> [2008-03-26 12:37:53+0000]
> Somebody asked me, so now I'm asking you...
> In Haskell, you can make "unboxed" arrays of certain value types. These  
> are typically more efficient in space, and probably time too, and also  
> make the array strict in its values. However, you can only do this magic  
> trick for certain types - not for *all* types.
> Why is that? Is it because nobody has done anything about it yet? Is it  
> because it's thought to be "not necessary" in some way? Is there some  
> theoretical problem? Has somebody got a better idea?
> I did think it was along the lines of "oh, well, if you want to unbox a  
> type of your own, you just need to write your own instance". The thing  
> that makes me suspicious of this logic is the absense of an instance for  
> tuples. Surely this would be trivial to write, and yet it's not present.  
> If we had instances for a couple of sizes of tuples, it would surely be  
> quite easy to write your own custom instances that just sit on top of  
> this and tuple/untuple your custom values...
> Any insights here?

Could Data Parallel Haskell[1] be useful for you?
It was designed for parallel computation, but it includes unboxed
arrays, nice list-like syntax and array comprehensions.

  1. http://www.haskell.org/haskellwiki/GHC/Data_Parallel_Haskell
Roman I. Cheplyaka :: http://ro-che.info/
...being in love is totally punk rock...
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 307 bytes
Desc: Digital signature
Url : http://www.haskell.org/pipermail/haskell-cafe/attachments/20080326/2ac4ae6c/attachment.bin

More information about the Haskell-Cafe mailing list