3 ms·
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 wh
by richo 14y ago
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 14y agoWhen 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 14y agoMy 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.
- shurcooL 14y agoPerhaps it would be more accurate to say that a subset of the Git repo is a purely functional data structure. Wouldn't that be true? Probably a larger portion if the Git repo is --bare.