Go implementation of a persistent rope data structure, useful to manipulate large text. Persistent means that any operation on the rope doesn't modify it, so it's inherently thread safe.
TODO: Rebalancing
Package can be installed with go command:
go get github.com/vinzmay/go-rope
//Empty rope
r1 := new(rope.Rope)
//Initialized rope
r2 := rope.New("test rope")
r1 := rope.New("abc")
r2 := rope.New("def")
r3 := r1.Concat(r2) // "abcdef"
r1 := rope.New("abcdef")
r2, r3 := r1.Split(4) // "abcd", "ef"
r1 := rope.New("abcdef")
r2 := r1.Delete(3, 2) // "abef"
r1 := rope.New("abcdef")
r2 := r1.Insert(3, "xxx") // "abcxxxdef"
r1 := rope.New("abcdef")
r2 := r1.Substr(3, 2) // "cd"