Re: [Haskell-cafe] unboxed arrays restricted to simple types (Int, Float, ..)

2009-11-16 Thread Henning Thielemann
On Wed, 11 Nov 2009, Tom Nielsen wrote: There's a couple of things going on here: -If you use storablevector and storable-tuple, or uvector, you can store tuples of things. So your stupidArrayElement could be mimicked by (Int, Int). Btw. there is Data.Array.Storable. Maybe I should just add

Re: [Haskell-cafe] unboxed arrays restricted to simple types (Int, Float, ..)

2009-11-11 Thread Tom Nielsen
There's a couple of things going on here: -If you use storablevector and storable-tuple, or uvector, you can store tuples of things. So your stupidArrayElement could be mimicked by (Int, Int). -But what you want to do is store a variable-sized data type. How would you do that in C? If you can spa

Re: [Haskell-cafe] unboxed arrays restricted to simple types (Int, Float, ..)

2009-11-11 Thread Eugene Kirpichov
You might also look at how Data Parallel Haskell implements its arrays. IIRC, it implements an array of n-field records as n arrays. You can easily do that with typeclasses and type families. 2009/11/11 Tillmann Vogt : > Hi, > > I tried to use unboxed arrays for generating an antialiased texture.

Re: [Haskell-cafe] unboxed arrays restricted to simple types (Int, Float, ..)

2009-11-11 Thread Hemanth Kapila
On Wed, Nov 11, 2009 at 5:28 PM, Tillmann Vogt wrote: > Hi, > > I tried to use unboxed arrays for generating an antialiased texture. To > make it easier to understand, here is the stripped down code that produces > an error: > > >import Control.Monad.ST > >import Data.Array.ST > >import Data.Arra

Re: [Haskell-cafe] unboxed arrays restricted to simple types (Int, Float, ..)

2009-11-11 Thread Svein Ove Aas
On Wed, Nov 11, 2009 at 12:58 PM, Tillmann Vogt wrote: > Hi, > > I tried to use unboxed arrays for generating an antialiased texture. To make > it easier to understand, here is the stripped down code that produces an > error: > *snip* > > What do you think? > It is generally acknowledged that the

[Haskell-cafe] unboxed arrays restricted to simple types (Int, Float, ..)

2009-11-11 Thread Tillmann Vogt
Hi, I tried to use unboxed arrays for generating an antialiased texture. To make it easier to understand, here is the stripped down code that produces an error: >import Control.Monad.ST >import Data.Array.ST >import Data.Array.Unboxed >import Data.Word >type BitMask = UArray Int Word16 -- for

Re: [Haskell-cafe] Unboxed arrays

2008-03-26 Thread Andrew Coppin
Don Stewart wrote: It's very active. See: http://haskell.org/haskellwiki/GHC/Data_Parallel_Haskell and watch the commits coming in from Roman. *digs around* Hmm. So in summary, stuff is happening behind the scenes, there's just not a lot of visible activity at the surface.

Re: [Haskell-cafe] Unboxed arrays

2008-03-26 Thread Don Stewart
andrewcoppin: > Janis Voigtlaender wrote: > >Google -> http://research.microsoft.com/~simonpj/papers/ndp/ > > > >I don't think the above suggests that "nothing is happening" ... > > The latet thing on that page is dated over a year ago. It's very active. See: http://haskell.org/haskellwiki/G

Re: [Haskell-cafe] Unboxed arrays

2008-03-26 Thread Jed Brown
On Wed 2008-03-26 19:50, Bulat Ziganshin wrote: > Hello Jed, > > Wednesday, March 26, 2008, 7:02:28 PM, you wrote: > > > StorableArray. Unfortunately there is a performance hit to using Storable > > versus the built in unboxed types. > > are you sure? it was in ghc 6.4, now afair they should be

Re[2]: [Haskell-cafe] Unboxed arrays

2008-03-26 Thread Bulat Ziganshin
Hello Jed, Wednesday, March 26, 2008, 7:02:28 PM, you wrote: > StorableArray. Unfortunately there is a performance hit to using Storable > versus the built in unboxed types. are you sure? it was in ghc 6.4, now afair they should be the same. look in http://haskell.org/haskellwiki/Modern_array_l

Re: [Haskell-cafe] Unboxed arrays

2008-03-26 Thread Jed Brown
On Wed 2008-03-26 14:22, Henning Thielemann wrote: > A light-weight unboxed array variant is: > http://code.haskell.org/~sjanssen/storablevector/ There is also CArray which offers an immutable interface for any Storable. http://hackage.haskell.org/cgi-bin/hackage-scripts/package/carray You can

Re: [Haskell-cafe] Unboxed arrays

2008-03-26 Thread Roman Cheplyaka
* Henning Thielemann <[EMAIL PROTECTED]> [2008-03-26 14:22:20+0100] > > On Wed, 26 Mar 2008, Roman Cheplyaka wrote: > >> * Andrew Coppin <[EMAIL PROTECTED]> [2008-03-26 12:37:53+] >>> Somebody asked me, so now I'm asking you... >>> >>> In Haskell, you can make "unboxed" arrays of certain value

Re: [Haskell-cafe] Unboxed arrays

2008-03-26 Thread Janis Voigtlaender
Andrew Coppin wrote: Janis Voigtlaender wrote: Google -> http://research.microsoft.com/~simonpj/papers/ndp/ I don't think the above suggests that "nothing is happening" ... The latet thing on that page is dated over a year ago. Well, if you expect monthly updates... -- Dr. Janis Voigtlae

Re: [Haskell-cafe] Unboxed arrays

2008-03-26 Thread Andrew Coppin
Janis Voigtlaender wrote: Google -> http://research.microsoft.com/~simonpj/papers/ndp/ I don't think the above suggests that "nothing is happening" ... The latet thing on that page is dated over a year ago. ___ Haskell-Cafe mailing list Haskell-Cafe

Re: [Haskell-cafe] Unboxed arrays

2008-03-26 Thread Janis Voigtlaender
Andrew Coppin wrote: Roman Cheplyaka wrote: * Andrew Coppin <[EMAIL PROTECTED]> [2008-03-26 12:37:53+] 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 c

Re: [Haskell-cafe] Unboxed arrays

2008-03-26 Thread Andrew Coppin
Roman Cheplyaka wrote: * Andrew Coppin <[EMAIL PROTECTED]> [2008-03-26 12:37:53+] 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. htt

Re: [Haskell-cafe] Unboxed arrays

2008-03-26 Thread Henning Thielemann
On Wed, 26 Mar 2008, Roman Cheplyaka wrote: * Andrew Coppin <[EMAIL PROTECTED]> [2008-03-26 12:37:53+] 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

Re: [Haskell-cafe] Unboxed arrays

2008-03-26 Thread Roman Cheplyaka
* Andrew Coppin <[EMAIL PROTECTED]> [2008-03-26 12:37:53+] > 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

Re: [Haskell-cafe] Unboxed arrays

2008-03-26 Thread Bulat Ziganshin
Hello Andrew, Wednesday, March 26, 2008, 3:37:53 PM, you wrote: > 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. > Any insights here? and even insiders :) i've rewrote arrays library to

[Haskell-cafe] Unboxed arrays

2008-03-26 Thread Andrew Coppin
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