by gosub · 11y ago · 0 comments
data Edit a = Insert Int a
| Delete Int
given that a Delete only needs the place of deletion and a Replace is a Delete followed by an Insert?- Insert Int File == "create file"
- Delete Int File == "delete file"
- Replace Int File == "patch file"
Removing and Inserting a file each time it changes, while technically correct is probably not what you want.
The nice thing about what Liam proposes (and type classes in general) is that it doesn't matter what we each interpret `a` to be.