feldspar-language-0.6.0.2: A functional embedded language for DSP and parallelism

Safe HaskellNone

Feldspar.Vector

Description

A module for virtual vectors. Many of the functions defined here are imitations of Haskell's list operations, and to a first approximation they behave accordingly.

A virtual vector is normally guaranteed not to be present in the generated code. The only exceptions are:

  • when it is explicitly forced using the functions force or desugar
  • when it is the input or output of a program
  • when it is accessed by a function outside the Feldspar.Vector API, for example, condition or forLoop

Note also that most operations only introduce a small constant overhead on the vector. The exceptions are

  • fold
  • fold1
  • Functions that introduce storage (see above)
  • "Folding" functions: sum, maximum, etc.

These functions introduce overhead that is linear in the length of the vector.

Documentation