Unexpected behaviour from "fromListUnboxed"

32 views
Skip to first unread message

Neil Jamieson

unread,
Dec 10, 2013, 5:46:54 AM12/10/13
to haskel...@googlegroups.com
Hullo,

I am playing with REPA (along with Accelerate).  I found my programme was stalling and gobbling memory.  It took me a while to realise that fromListUnboxed did not do what I assumed it would - limit it's consumption of the list to that needed to fill the specified array extend.  Specifically I used it like this...


fromListUnboxed (Z:.s:.s) [0.0,0.0..]

This displayed the behaviour reported above - which seems to me inconsistent with Haskell's normal mode of operation - take only what you need.

I fixed it by adding a "take"

fromListUnboxed (Z:.s:.s) (take (s*s) [0.0,0.0..])

I know this is not really a bug, but wonder if you would consider changing the behaviour to match my expectations (outrageous egocentricity I know).

:-))

Neil

Ben Lippmeier

unread,
Dec 13, 2013, 10:58:57 PM12/13/13
to Neil Jamieson, haskel...@googlegroups.com

On 10/12/2013, at 21:46 , Neil Jamieson <neilj...@gmail.com> wrote:
>
> fromListUnboxed (Z:.s:.s) (take (s*s) [0.0,0.0..])

Thanks for the report. Yes, this will diverge when it tries to determine the length of the list. I'll make sure it gets fixed in the next release (to match the new GHC release).

Cheers,
Ben.

niko...@gmail.com

unread,
Jun 21, 2014, 8:52:23 AM6/21/14
to haskel...@googlegroups.com
I have unexpected this, too. Still not fixed in 3.2.5.1 (just a friendly remainder).

Nikolay.
Reply all
Reply to author
Forward
0 new messages