
Git is a purely functional data structure - alipang
http://www.jayway.com/2013/03/03/git-is-a-purely-functional-data-structure/
======
richo
being immutable and being functional aren't even close to the same thing. It
just so happens that git's object db is immutable, although even then it
depends what you're talking about.

It's most interesting property is that it's content-addressable, but still has
tons of mutable elements, refs, symbolic refs, config keys, the notes
infrastructure (kinda).

~~~
alipang
When the post makes an argument that Git _is_ a functional data structure,
this refers to a mental model of how to think about git.

Of course there are mutable elements, such as branch pointers etc. Also, a
functional data structure also does non-functional tings underneath, such as
modifying references. The important thing to note is that it provides a _view_
that can be thought of as immutable and functional.

~~~
richo
My point is that "functional" is meaningless in this context. "Compatible with
purely functional programming" maybe, but "functional" tells you nothing,
especially when you can't embed computation (functions) in a git database
without some extra abstraction.

------
toolslive
Isn't the word he's looking for 'persistent' ?
<http://en.wikipedia.org/wiki/Persistent_data_structure>

~~~
nkurz
He explains his word choice near the end of the article:

 _(Another name for functional data structures are persistent. I've avoided
this term not to confuse it with the notion of storage on persistent media
like a physical disc.)_

~~~
alipang
Yeah. The naming choice is a reference to Chris Okasaki's book Purely
functional data structures.

------
shurcooL
Very nice read.

