Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell2010 |
Synopsis
- 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
Instances
Concrete Unicode Source # | |
Defined in CPython.Types.Unicode concreteType :: Unicode -> Type | |
Object Unicode Source # | |
Defined in CPython.Types.Unicode toObject :: Unicode -> SomeObject Source # | |
Sequence Unicode Source # | |
Defined in CPython.Protocols.Sequence toSequence :: Unicode -> SomeSequence Source # |
data ErrorHandling Source #
Instances
Show ErrorHandling Source # | |
Defined in CPython.Types.Unicode showsPrec :: Int -> ErrorHandling -> ShowS # show :: ErrorHandling -> String # showList :: [ErrorHandling] -> ShowS # | |
Eq ErrorHandling Source # | |
Defined in CPython.Types.Unicode (==) :: ErrorHandling -> ErrorHandling -> Bool # (/=) :: ErrorHandling -> ErrorHandling -> Bool # |
unicodeType :: Type 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.
data MatchDirection Source #
Instances
Show MatchDirection Source # | |
Defined in CPython.Types.Unicode showsPrec :: Int -> MatchDirection -> ShowS # show :: MatchDirection -> String # showList :: [MatchDirection] -> ShowS # | |
Eq MatchDirection Source # | |
Defined in CPython.Types.Unicode (==) :: MatchDirection -> MatchDirection -> Bool # (/=) :: MatchDirection -> MatchDirection -> Bool # |
data FindDirection Source #
Instances
Show FindDirection Source # | |
Defined in CPython.Types.Unicode showsPrec :: Int -> FindDirection -> ShowS # show :: FindDirection -> String # showList :: [FindDirection] -> ShowS # | |
Eq FindDirection Source # | |
Defined in CPython.Types.Unicode (==) :: FindDirection -> FindDirection -> Bool # (/=) :: FindDirection -> FindDirection -> Bool # |
:: 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.