[Haskell-cafe] Structural sharing in haskell data structures?

Don Stewart dons at galois.com
Tue May 12 18:06:15 EDT 2009


wagner.andrew:
>     Purity allows our data structures to have a lot of sharing.
>     This is separate to laziness.
> 
> 
> Ah, so haskell does do it. Interesting that it so rarely comes up, whereas it's
> frequently mentioned in clojure.

I think it is just assumed, since that's been the case for 20 years or
more now. Sharing is kind of exciting to the ex-Java people looking at
Clojure, I guess, since it's a new idea. So they talk about it.

>     Laziness lets us build up interesting structures that have unusual
>     sharing.
> 
>     Actually, what kind of persistant structures does Clojure have at this
>     stage? I was under the impression they were reusing Java data
>     structures. E.g. some of the nicer ones on hackage are zippers, patricia
>     tries, finger trees, which I can't imaging have been ported.
> 
> It has some built-in persistent data structures: lists, vectors (arrays), maps,
> and sets. It also has strong interoperability with Java, so that any existing
> Java library can easily be used in Clojure code. In some ways, that makes it a
> VERY mature language already.

Certainly the JVM and its libraries are mature.

Looks like yet another example of tech incubation in Haskell, then
dispersal outwards to other langs. The more the better.

-- Don


More information about the Haskell-Cafe mailing list