lean4-htt/library/init/data/string
Leonardo de Moura 26da50ab0e feat(library/vm/vm_string): efficient iterator.extract
@kha I've added

   iterator.extract : iterator -> iterator -> option string

It returns `none` if the iterators are "incompatible".
If this function is inconvenient to use, we can change it and return the
empty string in these cases.

Given iterators `it1` and `it2`, if they are sharing the same string
object in memory, then the cost is O(pos(it2) - pos(it1)).
If not, we have an extra O(N) step where we check whether the strings
being iterated by it1 and it2 are equal (`N` is the size of the strings).
In most applications, I believe the iterators will share the string
object.

I didn't test the code much. BTW, I found an unrelated bug at
vm_string.cpp. So, I'm not very confident this code is rock solid.
2018-01-10 13:27:28 -08:00
..
basic.lean feat(library/vm/vm_string): efficient iterator.extract 2018-01-10 13:27:28 -08:00
default.lean feat(library/vm/vm_string): add builtin VM implementation for string.has_decidable_eq 2017-10-23 10:55:26 -07:00
instances.lean feat(library/vm/vm_string): add builtin VM implementation for string.has_decidable_eq 2017-10-23 10:55:26 -07:00