On 28/04/14 00:22, John Lato wrote:I haven't checked yet, but should it matter?
> Are unboxed vectors faster? My rule of thumb is to use them over
> Data.Vector whenever possible.
Because my goal is that the vector never be created *at all*, and boxed
or not shouldn't make a difference on that!
Also haven't checked that yet, but I suspect that instead of something
> I would expect it's because you never force the argument. With
> `enumFromTo` the argument is forced because it needs to be checked for
> termination, but `enumFromN` is probably building up a big chain of
> thunks. I guess for this case `enumFromN` has no benefit over
> `enumFromTo` because the intention is to create a single loop instead of
> actually allocating the vector, so the warning in the documentation
> doesn't necessarily apply.
thunk-related, the thing plainly allocates the vector.
Just to clarify: `V.enumFromTo` works much better than `V.enumFromN`
because in contrast to the latter it doesn't actually try to create the
fully sized vector.
_______________________________________________
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe