Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
Categorical Theory of Patches
Search
Hunter Madison
August 24, 2016
0
65
Categorical Theory of Patches
Hunter Madison
August 24, 2016
Tweet
Share
More Decks by Hunter Madison
See All by Hunter Madison
Vala and Objective C
hmadison
0
230
Sutures
hmadison
0
59
Featured
See All Featured
No one is an island. Learnings from fostering a developers community.
thoeni
16
2.1k
RailsConf 2023
tenderlove
4
540
Distributed Sagas: A Protocol for Coordinating Microservices
caitiem20
322
20k
Thoughts on Productivity
jonyablonski
58
3.8k
StorybookのUI Testing Handbookを読んだ
zakiyama
13
4.6k
Product Roadmaps are Hard
iamctodd
44
9.7k
Large-scale JavaScript Application Architecture
addyosmani
504
110k
Easily Structure & Communicate Ideas using Wireframe
afnizarnur
187
16k
Music & Morning Musume
bryan
41
5.6k
VelocityConf: Rendering Performance Case Studies
addyosmani
320
23k
The Pragmatic Product Professional
lauravandoore
25
5.8k
GraphQLとの向き合い方2022年版
quramy
32
12k
Transcript
A Categorical Theory of Patches Hunter Madison
[email protected]
@355E3B lobste.rs/3553eb
Version Control
Time • One direction (forward) • Events (commits) have a
distinct order
Files • Things on disk • Contain stuff we want
to version
Patches • Instructions that let us transform one file into
a second one
Groups and Categories
Group • Set of elements, with an operation which combines
any two elements to form a third element • The operation satisfies the group axioms (Closure, Associativity, Identity and Invertibility)
Category • Objects linked by morphisms (functions) • We only
care about Associativity, Identity • Mesh Like
Category By IkamusumeFan - Own work, CC BY-SA 4.0, https://
commons.wikimedia.org/w/index.php?curid=36599484
Pushout • Two new morphisms which go to some new
object
Pushout (Yes, this came from the Wikipieda page)
Categorical Theory of Patches
Linking this up • Files -> Objects • Morphisms ->
Patches
L • Is the set of all files and patches
• Is partially ordered (vs linearly ordered) • We can use a pushout to resolve our merges
Merging
Merging • I’m skipping this • Myers or Patience diff
handles this.
Implementation
Implementation • Darcs* - http://darcs.net/ • Camp - http://projects.haskell.org/camp/ •
Pijul - http://pijul.org/
Demo Time
None
This paper, I love • Its not going to replace
the one true VCS • But, we can use it to recast to a different model
Recasting • Instead of focusing on how to solve corner
cases, we can instead find a general solution and build a concrete description • In general, we can do this for any problem
Reading List • “A FORMALIZATION OF DARCS PATCH THEORY USING
INVERSE SEMIGROUPS” - ftp:// ftp.math.ucla.edu/pub/camreport/cam09-83.pdf • “Camp Path Theory” - http://projects.haskell.org/ camp/files/theory.pdf • “The Theory of patches-vector” - http:// liamoc.net/posts/2015-11-10-patch-theory.html