[Haskell-cafe] How to use arrays efficiently?
Don Stewart
dons at galois.com
Fri May 16 14:42:51 EDT 2008
You'd have to write a wrapper that implements an array of triples
as a triple of arrays. This isn't too hard.
There's a new library in the works that should make this a lot easier
-- Don
abhay.parvate:
> As far as I know, you can't. It needs machine representable types, such as
> Int, Double, Char, etc. But making a tuple of three UArray Int Double may
> help.
>
> 2008/5/16 Lauri Oksanen <[1]lassoken at gmail.com>:
>
> Thanks for help. I did some tests with UArray and it does the trick.
> The problem remaining is, how to implement UArray Int (Double, Double,
> Double)?
> UArray source code is far too cryptic for me.
>
> Regards,
> Lauri
>
> On Fri, May 16, 2008 at 11:37 AM, Bulat Ziganshin
> <[2]bulat.ziganshin at gmail.com> wrote:
>
> Hello Lauri,
>
> Friday, May 16, 2008, 12:19:29 PM, you wrote:
>
> > pixelArray :: Array Int Color
>
> it's boxed array which means that its elements are stored as thunks
> computed only when you actually use them. try UArray instead:
>
> [3]http://haskell.org/haskellwiki/Modern_array_libraries
>
> --
> Best regards,
> Bulat mailto:[4]Bulat.Ziganshin at gmail.com
>
> _______________________________________________
> Haskell-Cafe mailing list
> [5]Haskell-Cafe at haskell.org
> [6]http://www.haskell.org/mailman/listinfo/haskell-cafe
>
> References
>
> Visible links
> 1. mailto:lassoken at gmail.com
> 2. mailto:bulat.ziganshin at gmail.com
> 3. http://haskell.org/haskellwiki/Modern_array_libraries
> 4. mailto:Bulat.Ziganshin at gmail.com
> 5. mailto:Haskell-Cafe at haskell.org
> 6. http://www.haskell.org/mailman/listinfo/haskell-cafe
> _______________________________________________
> Haskell-Cafe mailing list
> Haskell-Cafe at haskell.org
> http://www.haskell.org/mailman/listinfo/haskell-cafe
More information about the Haskell-Cafe
mailing list