[Haskell-cafe] Collections

Andrew Coppin andrewcoppin at btinternet.com
Tue Jun 19 15:50:13 EDT 2007


Adam Turoff wrote:
> - Data.Map (more commonly known as 'dictionaries')

Ah yes, I've heard about this one.

>  - Data.HashTable (same idea, different runtime characteristics)

Well, you learn something every day... (And that, of course, is the 
reason for asking questions in the first place!)

>  - many varieties of Data.Array (fixed sized arrays, with
>     quick access to any element)

Again, well known... uh... well not "friends" exactly, but yeah.

>  - Data.Sequence

What's that do?

>  - Data.Set
>

IIRC, doesn't that only work for types in Ord?

> The core language also offers tuples, which are a very interesting
> kind of collection, if very primitive.

Tuples are definitely "interesting". They are of course a sort-of 
"collection", although not in the usually used sense.

Here in Haskell, we also have Maybe, another "interesting" collection 
type...

> Also, tree structures are trivial
> to create that it is often easier to define the precise tree structure
> you want instead of reusing one of a dozen possible modules.

I read in The Fun of Programming an implementation of [several kinds of] 
heaps in Haskell. It was a joy to behold... (I don't see any heaps in 
the standard libraries though...?)



More information about the Haskell-Cafe mailing list