[Haskell-cafe] Re: Implementing fixed-sized vectors (using datatype algebra?)

Alfonso Acosta alfonso.acosta at gmail.com
Wed Feb 20 12:07:13 EST 2008

On Wed, Feb 20, 2008 at 11:26 AM, Wolfgang Jeltsch
<g9ks157k at acme.softbase.org> wrote:
>  Hello Fons,
>  why do you use the term vector?  I'd say that this term is more or less wrong
>  for what this type is about.  The distinguishing property of vectors compared
>  to lists is that there is addition and scalar multiplication for vectors.

That depends on how you interpret the word vector, which is
polysemous: http://en.wikipedia.org/wiki/Vector

You are interpreting it as "An element in a vector space, often
represented as a coordinate vector" whereas in this case I try to mean
"A one-dimensional array".

> The data type you defined is a fixed size list.

The fact that FSVec is internally implemented using lists doesn't
imply that FSVec should be interpreted as a list. FSVec is an ADT and
I could as well have used something else to implement it (inmutable
arrays for instance).

More information about the Haskell-Cafe mailing list