rio-0.1.18.0: A standard library for Haskell

Safe Haskell | Safe
Language | Haskell2010

RIO.Char

Contents

- Character classification
  - Subranges
  - Unicode general categories
- Case conversion
- Numeric representations
- String representations

Description

Unicode `Char`. Import as:

    import qualified RIO.Char as C

This module does not export any partial functions. For those, see RIO.Char.Partial

Synopsis

- data Char
- isControl :: Char -> Bool
- isSpace :: Char -> Bool
- isLower :: Char -> Bool
- isUpper :: Char -> Bool
- isAlpha :: Char -> Bool
- isAlphaNum :: Char -> Bool
- isPrint :: Char -> Bool
- isDigit :: Char -> Bool
- isOctDigit :: Char -> Bool
- isHexDigit :: Char -> Bool
- isLetter :: Char -> Bool
- isMark :: Char -> Bool
- isNumber :: Char -> Bool
- isPunctuation :: Char -> Bool
- isSymbol :: Char -> Bool
- isSeparator :: Char -> Bool
- isAscii :: Char -> Bool
- isLatin1 :: Char -> Bool
- isAsciiUpper :: Char -> Bool
- isAsciiLower :: Char -> Bool
- data GeneralCategory
  - = UppercaseLetter
  - | LowercaseLetter
  - | TitlecaseLetter
  - | ModifierLetter
  - | OtherLetter
  - | NonSpacingMark
  - | SpacingCombiningMark
  - | EnclosingMark
  - | DecimalNumber
  - | LetterNumber
  - | OtherNumber
  - | ConnectorPunctuation
  - | DashPunctuation
  - | OpenPunctuation
  - | ClosePunctuation
  - | InitialQuote
  - | FinalQuote
  - | OtherPunctuation
  - | MathSymbol
  - | CurrencySymbol
  - | ModifierSymbol
  - | OtherSymbol
  - | Space
  - | LineSeparator
  - | ParagraphSeparator
  - | Control
  - | Format
  - | Surrogate
  - | PrivateUse
  - | NotAssigned
- generalCategory :: Char -> GeneralCategory
- toUpper :: Char -> Char
- toLower :: Char -> Char
- toTitle :: Char -> Char
- ord :: Char -> Int
- showLitChar :: Char -> ShowS
- lexLitChar :: ReadS String
- readLitChar :: ReadS Char

# Documentation

data Char #

#### Instances

Instances details

Bounded Char |
Instance details Defined in GHC.Enum Methods minBound :: Char # maxBound :: Char #
Enum Char |
Instance details Defined in GHC.Enum Methods succ :: Char -> Char # pred :: Char -> Char # toEnum :: Int -> Char # fromEnum :: Char -> Int # enumFrom :: Char -> [Char] enumFromThen :: Char -> Char -> [Char] enumFromTo :: Char -> Char -> [Char] enumFromThenTo :: Char -> Char -> Char -> [Char]
Eq Char |
Instance details Defined in GHC.Classes Methods (==) :: Char -> Char -> Bool # (/=) :: Char -> Char -> Bool #
Data Char |

Instance details

Defined in Data.Data

Methods

gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> Char -> c Char #

gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c Char #

toConstr :: Char -> Constr #

dataTypeOf :: Char -> DataType #

dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c Char) #

dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c Char) #

gmapT :: (forall b. Data b => b -> b) -> Char -> Char #

gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> Char -> r #

gmapQr :: forall r r'. (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> Char -> r #

gmapQ :: (forall d. Data d => d -> u) -> Char -> [u] #

gmapQi :: Int -> (forall d. Data d => d -> u) -> Char -> u #

gmapM :: Monad m => (forall d. Data d => d -> m d) -> Char -> m Char #

gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> Char -> m Char #

gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> Char -> m Char #

Ord Char |
Instance details Defined in GHC.Classes Methods compare :: Char -> Char -> Ordering # (<) :: Char -> Char -> Bool # (<=) :: Char -> Char -> Bool # (>) :: Char -> Char -> Bool # (>=) :: Char -> Char -> Bool # max :: Char -> Char -> Char # min :: Char -> Char -> Char #
Read Char |
Instance details Defined in GHC.Read Methods readsPrec :: Int -> ReadS Char readList :: ReadS [Char] readPrec :: ReadPrec Char readListPrec :: ReadPrec [Char]
Show Char |
Instance details Defined in GHC.Show Methods showsPrec :: Int -> Char -> ShowS show :: Char -> String # showList :: [Char] -> ShowS
Ix Char |
Instance details Defined in GHC.Arr Methods range :: (Char, Char) -> [Char] index :: (Char, Char) -> Char -> Int unsafeIndex :: (Char, Char) -> Char -> Int inRange :: (Char, Char) -> Char -> Bool rangeSize :: (Char, Char) -> Int unsafeRangeSize :: (Char, Char) -> Int
Lift Char |
Instance details Defined in Language.Haskell.TH.Syntax Methods lift :: Char -> Q Exp
Hashable Char |
Instance details Defined in Data.Hashable.Class Methods hashWithSalt :: Int -> Char -> Int Source # hash :: Char -> Int Source #
Storable Char |
Instance details Defined in Foreign.Storable Methods sizeOf :: Char -> Int # alignment :: Char -> Int # peekElemOff :: Ptr Char -> Int -> IO Char # pokeElemOff :: Ptr Char -> Int -> Char -> IO () # peekByteOff :: Ptr b -> Int -> IO Char # pokeByteOff :: Ptr b -> Int -> Char -> IO () # peek :: Ptr Char -> IO Char # poke :: Ptr Char -> Char -> IO () #
Prim Char |

Instance details

Defined in Data.Primitive.Types

Methods

sizeOf# :: Char -> Int# Source #

alignment# :: Char -> Int# Source #

indexByteArray# :: ByteArray# -> Int# -> Char Source #

readByteArray# :: MutableByteArray# s -> Int# -> State# s -> (# State# s, Char #) Source #

writeByteArray# :: MutableByteArray# s -> Int# -> Char -> State# s -> State# s Source #

setByteArray# :: MutableByteArray# s -> Int# -> Int# -> Char -> State# s -> State# s Source #

indexOffAddr# :: Addr# -> Int# -> Char Source #

readOffAddr# :: Addr# -> Int# -> State# s -> (# State# s, Char #) Source #

writeOffAddr# :: Addr# -> Int# -> Char -> State# s -> State# s Source #

setOffAddr# :: Addr# -> Int# -> Int# -> Char -> State# s -> State# s Source #

NFData Char |
Instance details Defined in Control.DeepSeq Methods rnf :: Char -> () #
Unbox Char |
Instance details Defined in Data.Vector.Unboxed.Base
Display Char Source # | Since: 0.1.0.0
Instance details Defined in RIO.Prelude.Display Methods display :: Char -> Utf8Builder Source # textDisplay :: Char -> Text Source #
ErrorList Char |
Instance details Defined in Control.Monad.Trans.Error Methods listMsg :: String -> [Char]
Vector Vector Char |

Instance details

Defined in Data.Vector.Unboxed.Base

Methods

basicUnsafeFreeze :: PrimMonad m => Mutable Vector (PrimState m) Char -> m (Vector Char) Source #

basicUnsafeThaw :: PrimMonad m => Vector Char -> m (Mutable Vector (PrimState m) Char) Source #

basicLength :: Vector Char -> Int Source #

basicUnsafeSlice :: Int -> Int -> Vector Char -> Vector Char Source #

basicUnsafeIndexM :: Monad m => Vector Char -> Int -> m Char Source #

basicUnsafeCopy :: PrimMonad m => Mutable Vector (PrimState m) Char -> Vector Char -> m () Source #

elemseq :: Vector Char -> Char -> b -> b Source #

MVector MVector Char |

Instance details

Defined in Data.Vector.Unboxed.Base

Methods

basicLength :: MVector s Char -> Int Source #

basicUnsafeSlice :: Int -> Int -> MVector s Char -> MVector s Char Source #

basicOverlaps :: MVector s Char -> MVector s Char -> Bool Source #

basicUnsafeNew :: PrimMonad m => Int -> m (MVector (PrimState m) Char) Source #

basicInitialize :: PrimMonad m => MVector (PrimState m) Char -> m () Source #

basicUnsafeReplicate :: PrimMonad m => Int -> Char -> m (MVector (PrimState m) Char) Source #

basicUnsafeRead :: PrimMonad m => MVector (PrimState m) Char -> Int -> m Char Source #

basicUnsafeWrite :: PrimMonad m => MVector (PrimState m) Char -> Int -> Char -> m () Source #

basicClear :: PrimMonad m => MVector (PrimState m) Char -> m () Source #

basicSet :: PrimMonad m => MVector (PrimState m) Char -> Char -> m () Source #

basicUnsafeCopy :: PrimMonad m => MVector (PrimState m) Char -> MVector (PrimState m) Char -> m () Source #

basicUnsafeMove :: PrimMonad m => MVector (PrimState m) Char -> MVector (PrimState m) Char -> m () Source #

basicUnsafeGrow :: PrimMonad m => MVector (PrimState m) Char -> Int -> m (MVector (PrimState m) Char) Source #

Generic1 (URec Char :: k -> Type) |
Instance details Defined in GHC.Generics Associated Types type Rep1 (URec Char) :: k -> Type Methods from1 :: forall (a :: k0). URec Char a -> Rep1 (URec Char) a to1 :: forall (a :: k0). Rep1 (URec Char) a -> URec Char a
Functor (URec Char :: Type -> Type) |
Instance details Defined in GHC.Generics Methods fmap :: (a -> b) -> URec Char a -> URec Char b # (<$) :: a -> URec Char b -> URec Char a #
Foldable (URec Char :: Type -> Type) |

Instance details

Defined in Data.Foldable

Methods

fold :: Monoid m => URec Char m -> m #

foldMap :: Monoid m => (a -> m) -> URec Char a -> m #

foldMap' :: Monoid m => (a -> m) -> URec Char a -> m

foldr :: (a -> b -> b) -> b -> URec Char a -> b #

foldr' :: (a -> b -> b) -> b -> URec Char a -> b

foldl :: (b -> a -> b) -> b -> URec Char a -> b #

foldl' :: (b -> a -> b) -> b -> URec Char a -> b #

foldr1 :: (a -> a -> a) -> URec Char a -> a #

foldl1 :: (a -> a -> a) -> URec Char a -> a #

toList :: URec Char a -> [a] #

null :: URec Char a -> Bool #

length :: URec Char a -> Int #

elem :: Eq a => a -> URec Char a -> Bool #

maximum :: Ord a => URec Char a -> a #

minimum :: Ord a => URec Char a -> a #

sum :: Num a => URec Char a -> a #

product :: Num a => URec Char a -> a #

Traversable (URec Char :: Type -> Type) |
Instance details Defined in Data.Traversable Methods traverse :: Applicative f => (a -> f b) -> URec Char a -> f (URec Char b) # sequenceA :: Applicative f => URec Char (f a) -> f (URec Char a) # mapM :: Monad m => (a -> m b) -> URec Char a -> m (URec Char b) # sequence :: Monad m => URec Char (m a) -> m (URec Char a) #
Eq (URec Char p) |
Instance details Defined in GHC.Generics Methods (==) :: URec Char p -> URec Char p -> Bool # (/=) :: URec Char p -> URec Char p -> Bool #
Ord (URec Char p) |
Instance details Defined in GHC.Generics Methods compare :: URec Char p -> URec Char p -> Ordering # (<) :: URec Char p -> URec Char p -> Bool # (<=) :: URec Char p -> URec Char p -> Bool # (>) :: URec Char p -> URec Char p -> Bool # (>=) :: URec Char p -> URec Char p -> Bool # max :: URec Char p -> URec Char p -> URec Char p # min :: URec Char p -> URec Char p -> URec Char p #
Show (URec Char p) |
Instance details Defined in GHC.Generics Methods showsPrec :: Int -> URec Char p -> ShowS show :: URec Char p -> String # showList :: [URec Char p] -> ShowS
Generic (URec Char p) |
Instance details Defined in GHC.Generics Associated Types type Rep (URec Char p) :: Type -> Type Methods from :: URec Char p -> Rep (URec Char p) x to :: Rep (URec Char p) x -> URec Char p
newtype Vector Char |
Instance details Defined in Data.Vector.Unboxed.Base newtype Vector Char = V_Char (Vector Char)
data URec Char (p :: k) |

Instance details

Defined in GHC.Generics

data URec Char (p :: k) = UChar {

- uChar# :: Char#

}

newtype MVector s Char |
Instance details Defined in Data.Vector.Unboxed.Base newtype MVector s Char = MV_Char (MVector s Char)
type Rep1 (URec Char :: k -> Type) |
Instance details Defined in GHC.Generics type Rep1 (URec Char :: k -> Type) = D1 ('MetaData "URec" "GHC.Generics" "base" 'False) (C1 ('MetaCons "UChar" 'PrefixI 'True) (S1 ('MetaSel ('Just "uChar#") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (UChar :: k -> Type)))
type Rep (URec Char p) |
Instance details Defined in GHC.Generics type Rep (URec Char p) = D1 ('MetaData "URec" "GHC.Generics" "base" 'False) (C1 ('MetaCons "UChar" 'PrefixI 'True) (S1 ('MetaSel ('Just "uChar#") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (UChar :: Type -> Type)))

# Character classification

Unicode characters are divided into letters, Data.Char.numbers, marks, punctuation, Data.Char.symbols, separators (including spaces) and others (including control characters).

isControl :: Char -> Bool #

isSpace :: Char -> Bool #

isLower :: Char -> Bool #

isUpper :: Char -> Bool #

isAlpha :: Char -> Bool #

isAlphaNum :: Char -> Bool #

isPrint :: Char -> Bool #

isDigit :: Char -> Bool #

isOctDigit :: Char -> Bool #

isHexDigit :: Char -> Bool #

isLetter :: Char -> Bool #

isMark :: Char -> Bool #

isNumber :: Char -> Bool #

isPunctuation :: Char -> Bool #

isSymbol :: Char -> Bool #

isSeparator :: Char -> Bool #

## Subranges

isAscii :: Char -> Bool #

isLatin1 :: Char -> Bool #

isAsciiUpper :: Char -> Bool #

isAsciiLower :: Char -> Bool #

## Unicode general categories

data GeneralCategory #

Constructors

UppercaseLetter |
LowercaseLetter |
TitlecaseLetter |
ModifierLetter |
OtherLetter |
NonSpacingMark |
SpacingCombiningMark |
EnclosingMark |
DecimalNumber |
LetterNumber |
OtherNumber |
ConnectorPunctuation |
DashPunctuation |
OpenPunctuation |
ClosePunctuation |
InitialQuote |
FinalQuote |
OtherPunctuation |
MathSymbol |
CurrencySymbol |
ModifierSymbol |
OtherSymbol |
Space |
LineSeparator |
ParagraphSeparator |
Control |
Format |
Surrogate |
PrivateUse |
NotAssigned |

#### Instances

Instances details

Bounded GeneralCategory |
Instance details Defined in GHC.Unicode Methods minBound :: GeneralCategory # maxBound :: GeneralCategory #
Enum GeneralCategory |

Instance details

Defined in GHC.Unicode

Methods

succ :: GeneralCategory -> GeneralCategory #

pred :: GeneralCategory -> GeneralCategory #

toEnum :: Int -> GeneralCategory #

fromEnum :: GeneralCategory -> Int #

enumFrom :: GeneralCategory -> [GeneralCategory]

enumFromThen :: GeneralCategory -> GeneralCategory -> [GeneralCategory]

enumFromTo :: GeneralCategory -> GeneralCategory -> [GeneralCategory]

enumFromThenTo :: GeneralCategory -> GeneralCategory -> GeneralCategory -> [GeneralCategory]

Eq GeneralCategory |
Instance details Defined in GHC.Unicode Methods (==) :: GeneralCategory -> GeneralCategory -> Bool # (/=) :: GeneralCategory -> GeneralCategory -> Bool #
Ord GeneralCategory |

Instance details

Defined in GHC.Unicode

Methods

compare :: GeneralCategory -> GeneralCategory -> Ordering #

(<) :: GeneralCategory -> GeneralCategory -> Bool #

(<=) :: GeneralCategory -> GeneralCategory -> Bool #

(>) :: GeneralCategory -> GeneralCategory -> Bool #

(>=) :: GeneralCategory -> GeneralCategory -> Bool #

max :: GeneralCategory -> GeneralCategory -> GeneralCategory #

min :: GeneralCategory -> GeneralCategory -> GeneralCategory #

Read GeneralCategory |
Instance details Defined in GHC.Read Methods readsPrec :: Int -> ReadS GeneralCategory readList :: ReadS [GeneralCategory] readPrec :: ReadPrec GeneralCategory readListPrec :: ReadPrec [GeneralCategory]
Show GeneralCategory |
Instance details Defined in GHC.Unicode Methods showsPrec :: Int -> GeneralCategory -> ShowS show :: GeneralCategory -> String # showList :: [GeneralCategory] -> ShowS
Ix GeneralCategory |

Instance details

Defined in GHC.Unicode

Methods

range :: (GeneralCategory, GeneralCategory) -> [GeneralCategory]

index :: (GeneralCategory, GeneralCategory) -> GeneralCategory -> Int

unsafeIndex :: (GeneralCategory, GeneralCategory) -> GeneralCategory -> Int

inRange :: (GeneralCategory, GeneralCategory) -> GeneralCategory -> Bool

rangeSize :: (GeneralCategory, GeneralCategory) -> Int

unsafeRangeSize :: (GeneralCategory, GeneralCategory) -> Int

generalCategory :: Char -> GeneralCategory #

# Case conversion

toUpper :: Char -> Char #

toLower :: Char -> Char #

toTitle :: Char -> Char #

# Numeric representations

ord :: Char -> Int #

# String representations

showLitChar :: Char -> ShowS #

lexLitChar :: ReadS String #

readLitChar :: ReadS Char #