Safe Haskell | None |
---|---|
Language | Haskell98 |
- data Unicode
- type Encoding = Text
- data ErrorHandling
- unicodeType :: Type
- toUnicode :: Text -> IO Unicode
- fromUnicode :: Unicode -> IO Text
- length :: Unicode -> IO Integer
- fromEncodedObject :: Object obj => obj -> Encoding -> ErrorHandling -> IO Unicode
- fromObject :: Object obj => obj -> IO Unicode
- encode :: Unicode -> Encoding -> ErrorHandling -> IO Bytes
- decode :: Bytes -> Encoding -> ErrorHandling -> IO Unicode
- append :: Unicode -> Unicode -> IO Unicode
- split :: Unicode -> Maybe Unicode -> Maybe Integer -> IO List
- splitLines :: Unicode -> Bool -> IO List
- translate :: Object table => Unicode -> table -> ErrorHandling -> IO Unicode
- join :: Sequence seq => Unicode -> seq -> IO Unicode
- data MatchDirection
- tailMatch :: Unicode -> Unicode -> Integer -> Integer -> MatchDirection -> IO Bool
- data FindDirection
- find :: Unicode -> Unicode -> Integer -> Integer -> FindDirection -> IO (Maybe Integer)
- count :: Unicode -> Unicode -> Integer -> Integer -> IO Integer
- replace :: Unicode -> Unicode -> Unicode -> Maybe Integer -> IO Unicode
- format :: Unicode -> Tuple -> IO Unicode
- contains :: Object element => Unicode -> element -> IO Bool
Unicode objects
data ErrorHandling Source #
unicodeType :: Type Source #
fromUnicode :: Unicode -> IO Text Source #
fromEncodedObject :: Object obj => obj -> Encoding -> ErrorHandling -> IO Unicode Source #
fromObject :: Object obj => obj -> IO Unicode Source #
Shortcut for fromEncodedObject
"utf-8" Strict
Methods and slot functions
translate :: Object table => Unicode -> table -> ErrorHandling -> IO Unicode Source #
Translate a string by applying a character mapping table to it.
The mapping table must map Unicode ordinal integers to Unicode ordinal
integers or None
(causing deletion of the character).
Mapping tables need only provide the getitem()
interface;
dictionaries and sequences work well. Unmapped character ordinals (ones
which cause a LookupError
) are left untouched and are copied as-is.
The error mode has the usual meaning for codecs.
join :: Sequence seq => Unicode -> seq -> IO Unicode Source #
Join a sequence of strings using the given separator.
:: Unicode | String |
-> Unicode | Substring |
-> Integer | Start |
-> Integer | End |
-> FindDirection | |
-> IO (Maybe Integer) |
Return the first position of the substring in string*[*start:end]
using the given direction. The return value is the index of the first
match; a value of Nothing
indicates that no match was found.
Return the number of non-overlapping occurrences of the substring in
string[start:end]
.
Replace occurrences of the substring with a given replacement. If the
maximum count is Nothing
, replace all occurences.