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).
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.
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.
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.)
8 comments
[ 4.0 ms ] story [ 28.2 ms ] threadIt'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).
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.
Probably a larger portion if the Git repo is --bare.
(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.)