[Haskell-cafe] Haskell arrays

michael rice nowgate at yahoo.com
Wed Dec 16 22:54:24 EST 2009


Example 7 (and others)

Input: array ('a','c') [('a',"AAA"),('b',"BBB"),('c',"CCC")] ! 'b'

Output: "BBB"

Maybe it's just the notation that makes it LOOK like the indices are also getting stored?


--- On Wed, 12/16/09, Daniel Peebles <pumpkingod at gmail.com> wrote:

From: Daniel Peebles <pumpkingod at gmail.com>
Subject: Re: [Haskell-cafe] Haskell arrays
To: "michael rice" <nowgate at yahoo.com>
Cc: haskell-cafe at haskell.org
Date: Wednesday, December 16, 2009, 10:46 PM

It doesn't store both, but does provides a flexible indexing strategy (that allows indices to be non-trivial values). What docs suggest that it stores both?

On Wed, Dec 16, 2009 at 10:38 PM, michael rice <nowgate at yahoo.com> wrote:

Based upon docs I've looked at, Haskell seems to store both an array element value AND its index/indices, whereas most languages just store the value and find its location in memory through mapping calculations.

Is it true?



Haskell-Cafe mailing list

Haskell-Cafe at haskell.org


-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.haskell.org/pipermail/haskell-cafe/attachments/20091216/2177816f/attachment.html

More information about the Haskell-Cafe mailing list