License | BSD-style |
---|---|
Maintainer | Haskell Foundation |
Stability | experimental |
Portability | portable |
Safe Haskell | None |
Language | Haskell2010 |
A AsciiString type backed by a ASCII
encoded byte array and all the necessary
functions to manipulate the string.
The recommended type is AsciiString
from UTF8
- data AsciiString
- create :: PrimMonad prim => CountOf CUChar -> (MutableAsciiString (PrimState prim) -> prim (Offset CUChar)) -> prim AsciiString
- replicate :: CountOf CUChar -> CUChar -> AsciiString
- fromBytesUnsafe :: UArray CUChar -> AsciiString
- toBytes :: AsciiString -> UArray CUChar
- copy :: AsciiString -> AsciiString
- lines :: AsciiString -> [AsciiString]
- words :: AsciiString -> [AsciiString]
Documentation
data AsciiString Source #
Opaque packed array of characters in the ASCII encoding
create :: PrimMonad prim => CountOf CUChar -> (MutableAsciiString (PrimState prim) -> prim (Offset CUChar)) -> prim AsciiString Source #
Binary conversion
fromBytesUnsafe :: UArray CUChar -> AsciiString Source #
Convert a Byte Array representing UTF8 data directly to a string without checking for UTF8 validity
If the input contains invalid sequences, it will trigger runtime async errors when processing data.
In doubt, use fromBytes
copy :: AsciiString -> AsciiString Source #
Copy the AsciiString
Legacy utility
lines :: AsciiString -> [AsciiString] Source #
words :: AsciiString -> [AsciiString] Source #