HORIZON HASKELLDocslts/ghc-10.0.x8fef28d2026-11-02Search packagesCtrl K
Theme: |

GHC 10.0.0.20260917 · lts/ghc-10.0.x · 8fef28d · 2026-11-02

datadata StringBuffer

A StringBuffer is an internal pointer to a sized chunk of bytes. The bytes are intended to be *immutable*. There are pure operations to read the contents of a StringBuffer.

A StringBuffer may have a finalizer, depending on how it was obtained.

Constructors

Instances1Show

Creation/destruction

Inspection

Return the first UTF-8 character of a nonempty StringBuffer and as well the remaining portion (analogous to Data.List.uncons). Warning: The behavior is undefined if the StringBuffer is empty. The result shares the same buffer as the original. Similar to utf8DecodeChar, if the character cannot be decoded as UTF-8, '\0' is returned.

Return the first UTF-8 character of a nonempty StringBuffer (analogous to Data.List.head). Warning: The behavior is undefined if the StringBuffer is empty. Similar to utf8DecodeChar, if the character cannot be decoded as UTF-8, '\0' is returned.

Moving and comparison

Conversion

Parsing integers

Checking for bi-directional format characters

Returns true if the buffer contains Unicode bi-directional formatting characters.

https://www.unicode.org/reports/tr9/#Bidirectional_Character_Types

Bidirectional format characters are one of 'x202a' : "U+202A LEFT-TO-RIGHT EMBEDDING (LRE)" 'x202b' : "U+202B RIGHT-TO-LEFT EMBEDDING (RLE)" 'x202c' : "U+202C POP DIRECTIONAL FORMATTING (PDF)" 'x202d' : "U+202D LEFT-TO-RIGHT OVERRIDE (LRO)" 'x202e' : "U+202E RIGHT-TO-LEFT OVERRIDE (RLO)" 'x2066' : "U+2066 LEFT-TO-RIGHT ISOLATE (LRI)" 'x2067' : "U+2067 RIGHT-TO-LEFT ISOLATE (RLI)" 'x2068' : "U+2068 FIRST STRONG ISOLATE (FSI)" 'x2069' : "U+2069 POP DIRECTIONAL ISOLATE (PDI)"

This list is encoded in bidirectionalFormatChars