String -http
A String is a list of characters. String constants in Haskell are values of type String.
The String type and associated operations.
Utilities for primitive marshalling of C strings.
The marshalling converts each Haskell character, representing a Unicode code point, to one or more bytes in a manner that, by default, is determined by the current locale. As a consequence, no guarantees can be made about the relative length of a Haskell string and its corresponding C string, and therefore all the marshalling routines include memory allocation. The translation between Unicode and the encoding of the current locale may be lossy.
String literal, with escapes interpreted
Parses and returns the specified string.
This module corresponds to parts of section 6.1.5 (String Queries) of the OpenGL 3.2 specs.
string s parses a sequence of characters given by s. Returns the parsed string (i.e. s).
> divOrMod = string "div"
> <|> string "mod"
String class library
Version 0.1.5.1
string-combinators provides handy polymorphic functions to build and combine string-like values.
All functions are polymorphic in their string-like type but usually have a Monoid or IsString constraint.
Version 0.6.0.3
Provides a simple type class for converting values of different string types into values of other string types.
Version 0.2
QuasiQuoter for non-interpolated strings, texts and bytestrings.
Version 0.0.2
QuasiQuoter for non-interpolated strings, texts and bytestrings.
Version 0.0.1
This lexeme parser parses a literal string. Returns the literal string value. This parsers deals correctly with escape sequences and gaps. The literal string is parsed according to the grammar rules defined in the Haskell report (which matches most programming languages quite closely).
A primitive C-style string, type Addr#
This package provides several functions to quickly search for substrings in strict or lazy ByteStrings. It also provides functions for breaking or splitting on substrings and replacing all occurrences of a substring (the first in case of overlaps) with another. GHC before 6.10 are no longer supported, other compilers only if they support BangPatterns. If you need it to work with other compilers, send a feature request.
Version 0.3.6.3
Memoize Strings as Atoms for fast comparison and sorting, with maps and sets
Version 0.0.6.1
Convert a String to Html, converting characters that need to be escaped to HTML entities.
Processing Strings into Html friendly things.
Make Strings an instance of Stream with Char token type.
utility function converting a String to a show function that simply prepends the string unchanged.
A C string is a reference to an array of C characters terminated by NUL.
A string with explicit length information in bytes instead of a terminating NUL (allowing NUL characters in the middle of the string).
A C wide string is a reference to an array of C wide characters terminated by NUL.
A wide character string with explicit length information in CWchars instead of a terminating NUL (allowing NUL characters in the middle of the string).
A sample hash function for Strings. We keep multiplying by the golden ratio and adding. The implementation is:
> hashString = foldl' f golden
>
> magic = 0xdeadbeef
Where hashInt32 works just as hashInt shown above.
Knuth argues that repeated multiplication by the golden ratio will minimize gaps in the hash space, and thus it's a good choice for combining together multiple keys to form one.
Here we know that individual characters c are often small, and this produces frequent collisions if we use ord c alone. A particular problem are the shorter low ASCII and ISO-8859-1 character strings. We pre-multiply by a magic twiddle factor to obtain a good distribution. In fact, given the following test:
> testp :: Int32 -> Int
> testp k = (n - ) . length . group . sort . map hs . take n $ ls
>
> hs = foldl' f golden
> f m c = fromIntegral (ord c) * k + hashInt32 m
> n = 100000
We discover that testp magic = 0.
Class for string-like datastructures; used by the overloaded string extension (-foverloaded-strings in GHC).
Show more results