On Mar 7, 2010, at 12:56 PM, Don Stewart wrote:

In fact, infinite vectors make no sense, as far as I can tell -- these
are fundamentally bounded structures.

Fourier analysis? Functional analysis? Hamel bases in Real analysis? There are lots of infinite dimensional vector spaces out there.

GHC even optimizes it to:

   fib = fib


Sounds like an implementation bug, not an infinite dimensional vector space bug. My guess is that strictness is getting in the way, and forcing what would be a lazy call to fib in the corresponding list code -- fib = 0 : 1 : (zipWith (+) fib (tail fib)) -- into a strict one.

In fact, I'm pretty sure that's what the problem is:

data Vector a = Vector {-# UNPACK #-} !Int
                       {-# UNPACK #-} !Int
                       {-# UNPACK #-} !(Array a)

The !'s mean "strict" right?
_______________________________________________
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe

Reply via email to