|
Data.PackedString | Portability | portable | Stability | experimental | Maintainer | libraries@haskell.org |
|
|
|
|
|
Description |
This API is deprecated. You might be able to use Data.ByteString
or Data.ByteString.Char8 from the bytestring package, provided you
don't need full Unicode support.
The long term aim is to provide a Unicode layer on Data.ByteString,
and then to provide a replacement for this Data.PackedString API based on
that.
|
|
Synopsis |
|
|
|
|
The PackedString type
|
|
|
A space-efficient representation of a String, which supports various
efficient operations. A PackedString contains full Unicode Chars.
| Instances | |
|
|
Converting to and from PackedStrings
|
|
|
Convert a String into a PackedString
|
|
|
Convert a PackedString into a String
|
|
I/O with PackedStrings
|
|
|
Outputs a PackedString to the specified Handle.
NOTE: the representation of the PackedString in the file is assumed to
be in the ISO-8859-1 encoding. In other words, only the least significant
byte is taken from each character in the PackedString.
|
|
|
Read a PackedString directly from the specified Handle.
This is far more efficient than reading the characters into a String
and then using packString.
NOTE: as with hPutPS, the string representation in the file is
assumed to be ISO-8859-1.
|
|
List-like manipulation functions
|
|
|
The nilPS value is the empty string.
|
|
|
The consPS function prepends the given character to the
given string.
|
|
|
The headPS function returns the first element of a PackedString or throws an
error if the string is empty.
|
|
|
The tailPS function returns the tail of a PackedString or throws an error
if the string is empty.
|
|
|
The nullPS function returns True iff the argument is null.
|
|
|
The appendPS function appends the second string onto the first.
|
|
|
The lengthPS function returns the length of the input list. Analogous to length.
|
|
|
The indexPS function returns the character in the string at the given position.
|
|
|
The mapPS function applies a function to each character in the string.
|
|
|
The filterPS function filters out the appropriate substring.
|
|
|
The reversePS function reverses the string.
|
|
|
The concatPS function concatenates a list of PackedStrings.
|
|
|
The elemPS function returns True iff the given element is in the string.
|
|
|
The substrPS function takes a PackedString and two indices
and returns the substring of the input string between (and including)
these indices.
|
|
|
The takePS function takes the first n characters of a PackedString.
|
|
|
The dropPS function drops the first n characters of a PackedString.
|
|
|
The splitWithPS function splits a PackedString at a given index.
|
|
|
The foldlPS function behaves like foldl on PackedStrings.
|
|
|
The foldrPS function behaves like foldr on PackedStrings.
|
|
|
The takeWhilePS function is analogous to the takeWhile function.
|
|
|
The dropWhilePS function is analogous to the dropWhile function.
|
|
|
The spanPS function returns a pair containing the result of
running both takeWhilePS and dropWhilePS.
|
|
|
The breakPS function breaks a string at the first position which
satisfies the predicate.
|
|
|
The linesPS function splits the input on line-breaks.
|
|
|
The unlinesPS function concatenates the input list after
interspersing newlines.
|
|
|
The wordsPS function is analogous to the words function.
|
|
|
The unwordsPS function is analogous to the unwords function.
|
|
|
The splitPS function splits the input string on each occurrence of the given Char.
|
|
|
The splitWithPS function takes a character predicate and splits the input string
at each character which satisfies the predicate.
|
|
|
The joinPS function takes a PackedString and a list of PackedStrings
and concatenates the list after interspersing the first argument between
each element of the list.
|
|
Produced by Haddock version 2.4.2 |