Re: [Haskell] Recursive definition of fibonacci with Data.Vector

8 Mar
2010
8 Mar
'10
2:58 p.m.
On Sun, 7 Mar 2010, Edgar Z. Alvarenga wrote:
Hello,
why I can't define a recursive vector using Data.Vector, like in the example:
import qualified Data.Vector as V
let fib = 0 `V.cons` (1 `V.cons` V.zipWith (+) fib (V.tail v))
Since I liked to have both element-wise lazy construction and packed data, I created a data-structure for that purpose: http://code.haskell.org/storablevector/Data/StorableVector/Cursor.hs However, those vectors/arrays are finite, but could be extended to a chunky infinite structure.
5556
Age (days ago)
5556
Last active (days ago)
0 comments
1 participants
participants (1)
-
Henning Thielemann