Rope is:module

A rope is a data strucure to efficiently store and manipulate long strings. Wikipedia provides a nice overview: https://en.wikipedia.org/wiki/Rope_(data_structure)
This module defines a rope data structure for use in Yi. This specific implementation uses a fingertree over Text. In contrast to our old implementation, we can now reap all the benefits of Text: automatic unicode handling and blazing fast implementation on underlying strings. This frees us from a lot of book-keeping. We don't lose out on not using ByteString directly because the old implementation encoded it into UTF8 anyway, making it unsuitable for storing anything but text.
If you're accustomed to working with text in almost any other programming language, you'd be aware that a "string" typically refers to an in-memory array of characters. Traditionally this was a single ASCII byte per character; more recently UTF-8 variable byte encodings which dramatically complicates finding offsets but which gives efficient support for the entire Unicode character space. In Haskell, the original text type, String, is implemented as a list of Char which, because a Haskell list is implemented as a linked-list of boxed values, is wildly inefficient at any kind of scale. In modern Haskell there are two primary ways to represent text. First is via the [rather poorly named] ByteString from the bytestring package (which is an array of bytes in pinned memory). The Data.ByteString.Char8 submodule gives you ways to manipulate those arrays as if they were ASCII characters. Confusingly there are both strict (Data.ByteString) and lazy (Data.ByteString.Lazy) variants which are often hard to tell the difference between when reading function signatures or haddock documentation. The performance problem an immutable array backed data type runs into is that appending a character (that is, ASCII byte) or concatonating a string (that is, another array of ASCII bytes) is very expensive and requires allocating a new larger array and copying the whole thing into it. This led to the development of "builders" which amortize this reallocation cost over time, but it can be cumbersome to switch between Builder, the lazy ByteString that results, and then having to inevitably convert to a strict ByteString because that's what the next function in your sequence requires. The second way is through the opaque Text type of Data.Text from the text package, which is well tuned and high-performing but suffers from the same design; it is likewise backed by arrays. (Historically, the storage backing Text objects was encoded in UTF-16, meaning every time you wanted to work with unicode characters that came in from anywhere else and which inevitably were UTF-8 encoded they had to be converted to UTF-16 and copied into a further new array! Fortunately Haskell has recently adopted a UTF-8 backed Text type, reducing this overhead. The challenge of appending pinned allocations remains, however.) In this package we introduce Rope, a text type backed by the 2-3 FingerTree data structure from the fingertree package. This is not an uncommon solution in many languages as finger trees support exceptionally efficient appending to either end and good performance inserting anywhere else (you often find them as the backing data type underneath text editors for this reason). Rather than Char the pieces of the rope are ShortText from the text-short package, which are UTF-8 encoded and in normal memory managed by the Haskell runtime. Conversion from other Haskell text types is not O(1) (UTF-8 validity must be checked, or UTF-16 decoded, or...), but in our benchmarking the performance has been comparable to the established types and you may find the resultant interface for combining chunks is comparable to using a Builder, without being forced to use a Builder. Rope is used as the text type throughout this library. If you use the functions within this package (rather than converting to other text types) operations are quite efficient. When you do need to convert to another type you can use fromRope or intoRope from the Textual typeclass. Note that we haven't tried to cover the entire gamut of operations or customary convenience functions you would find in the other libraries; so far Rope is concentrated on aiding interoperation, being good at appending (lots of) small pieces, and then efficiently taking the resultant text object out to a file handle, be that the terminal console, a file, or a network socket.
Functions for getting and setting GObject properties
This module contains a set of generally useful properties, which instance authors are encouraged to use in order to test their instances of the Serialise class. For example, if you have a data type which you might derive or write instances for:
data Foo = Foo { fooInt :: Int, fooBool :: Bool }
deriving (Eq, Show, Generic)
-- or, alternatively
instance Serialise Foo where
encode = ...
decode = ...
Then you can use this module to easily derive some quick properties:
import qualified Codec.Serialise.Properties as Props

fooSerialiseId :: Foo -> Bool
fooSerialiseId = Props.serialiseIdentity

fooFlatTermId :: Foo -> Bool
fooFlatTermId = Props.flatTermIdentity

fooHasValidFlatTerm :: Foo -> Bool
fooHasValidFlatTerm = Props.hasValidFlatTerm
You can then conveniently use these three functions with QuickCheck, for example.
A GPropertyAction is a way to get a Action with a state value reflecting and controlling the value of a Object property. The state of the action will correspond to the value of the property. Changing it will change the property (assuming the requested value matches the requirements as specified in the [typegObject.ParamSpec]). Only the most common types are presently supported. Booleans are mapped to booleans, strings to strings, signed/unsigned integers to int32/uint32 and floats and doubles to doubles. If the property is an enum then the state will be string-typed and conversion will automatically be performed between the enum value and ‘nick’ string as per the [typegObject.EnumValue] table. Flags types are not currently supported. Properties of object types, boxed types and pointer types are not supported and probably never will be. Properties of [typegLib.Variant] types are not currently supported. If the property is boolean-valued then the action will have a NULL parameter type, and activating the action (with no parameter) will toggle the value of the property. In all other cases, the parameter type will correspond to the type of the property. The general idea here is to reduce the number of locations where a particular piece of state is kept (and therefore has to be synchronised between). GPropertyAction does not have a separate state that is kept in sync with the property value — its state is the property value. For example, it might be useful to create a Action corresponding to the visible-child-name property of a `GtkStack` so that the current page can be switched from a menu. The active radio indication in the menu is then directly determined from the active page of the GtkStack. An anti-example would be binding the active-id property on a `GtkComboBox`. This is because the state of the combo box itself is probably uninteresting and is actually being used to control something else. Another anti-example would be to bind to the visible-child-name property of a `GtkStack` if this value is actually stored in Settings. In that case, the real source of the value is* Settings. If you want a Action to control a setting stored in Settings, see settingsCreateAction instead, and possibly combine its use with settingsBind. Since: 2.38
Information about a D-Bus property on a D-Bus interface. Since: 2.26
Low level JavaScript object property access. In most cases you should use Language.Javascript.JSaddle.Object instead. This module is mostly here to implement functions needed to use JSPropRef.
A GObject property value in a GtkExpression.
Tests for GenValidity instances
Tests for shrinking functions
valid value. This is a field defined with the purpose of contain the previous value of the property, but is not used anymore.
Tests for GenValidity instances