[Haskell-cafe] Specify array or list size?

Sebastian Sylvan sebastian.sylvan at gmail.com
Sat May 7 12:22:49 EDT 2005


On 5/7/05, Daniel Carrera <dcarrera at digitaldistribution.com> wrote:
> Hamilton Richards wrote:
> 
> > Well, for starters, lists and arrays are two entirely different topics.
> > I've noticed that Haskell newbies sometimes confuse them --possibly the
> > use of [] in list types and enumerations triggers an unconscious
> > association with [] used in conventional languages for array indexing.
> 
> I think it's because there's no real reason for someone to think that
> the words "list" and "array" might not be synonims. I certainly don't
> seen a linguistic distinction. Either term refers to an ordered
> collection of items.
> 

Hmm. Not sure I agree. For me an "array" is a fixed set of elements
which may or not contain stuff (not necessarily in a CS context but
just linguistically). A "list" is more of a linear structure.
An array is a sheet of paper with lines on it, a list is the todo-list
written on that paper.

Anyway. There is a difference, and I think the names reflect that pretty well.

/S

-- 
Sebastian Sylvan
+46(0)736-818655
UIN: 44640862


More information about the Haskell-Cafe mailing list