[Haskell-cafe] Haskell arrays

Bulat Ziganshin bulat.ziganshin at gmail.com
Thu Dec 17 03:35:22 EST 2009

Hello michael,

Thursday, December 17, 2009, 6:54:24 AM, you wrote:

what is you see here is called "association list". *function* array
takes an index range and assoclist and returns an array. notice that
data constructors are started with capital letter, f.e. Array

> http://www.zvon.org/other/haskell/Outputarray/array_f.html

> 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?

> Michael

> --- 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?

> Michael

> _______________________________________________
>  Haskell-Cafe mailing list
>  Haskell-Cafe at haskell.org
>  http://www.haskell.org/mailman/listinfo/haskell-cafe



Best regards,
 Bulat                            mailto:Bulat.Ziganshin at gmail.com

More information about the Haskell-Cafe mailing list