ascii-case-1.0.1.3: ASCII letter case
Safe HaskellSafe-Inferred
LanguageGHC2021

ASCII.Case

Description

Case is a property of letters. A-Z are upper case letters, and a-z are lower case letters. No other ASCII characters have case.

Synopsis

Documentation

data Case Source #

Constructors

UpperCase

The letters from CapitalLetterA to CapitalLetterZ.

LowerCase

The letters from SmallLetterA to SmallLetterZ.

Instances

Instances details
Data Case Source # 
Instance details

Defined in ASCII.Case

Methods

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

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

toConstr :: Case -> Constr #

dataTypeOf :: Case -> DataType #

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

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

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

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

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

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

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

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

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

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

Bounded Case Source # 
Instance details

Defined in ASCII.Case

Enum Case Source # 
Instance details

Defined in ASCII.Case

Methods

succ :: Case -> Case #

pred :: Case -> Case #

toEnum :: Int -> Case #

fromEnum :: Case -> Int #

enumFrom :: Case -> [Case] #

enumFromThen :: Case -> Case -> [Case] #

enumFromTo :: Case -> Case -> [Case] #

enumFromThenTo :: Case -> Case -> Case -> [Case] #

Generic Case Source # 
Instance details

Defined in ASCII.Case

Associated Types

type Rep Case :: Type -> Type #

Methods

from :: Case -> Rep Case x #

to :: Rep Case x -> Case #

Show Case Source # 
Instance details

Defined in ASCII.Case

Methods

showsPrec :: Int -> Case -> ShowS #

show :: Case -> String #

showList :: [Case] -> ShowS #

Eq Case Source # 
Instance details

Defined in ASCII.Case

Methods

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

(/=) :: Case -> Case -> Bool #

Ord Case Source # 
Instance details

Defined in ASCII.Case

Methods

compare :: Case -> Case -> Ordering #

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

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

(>) :: Case -> Case -> Bool #

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

max :: Case -> Case -> Case #

min :: Case -> Case -> Case #

Hashable Case Source # 
Instance details

Defined in ASCII.Case

Methods

hashWithSalt :: Int -> Case -> Int #

hash :: Case -> Int #

type Rep Case Source # 
Instance details

Defined in ASCII.Case

type Rep Case = D1 ('MetaData "Case" "ASCII.Case" "ascii-case-1.0.1.3-AnxOgehNvqC1dS5Adl0Z6d" 'False) (C1 ('MetaCons "UpperCase" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "LowerCase" 'PrefixI 'False) (U1 :: Type -> Type))

letterCase :: Char -> Maybe Case Source #

Determines whether a character is a letter, and if so, whether it is upper or lower case.

>>> map letterCase [CapitalLetterR, SmallLetterR, DollarSign]
[Just UpperCase,Just LowerCase,Nothing]

isCase :: Case -> Char -> Bool Source #

Determines whether a character is a letter of a particular case.

>>> map (isCase UpperCase) [CapitalLetterR,SmallLetterR,DollarSign]
[True,False,False]

toCase :: Case -> Char -> Char Source #

Maps a letter character to its upper/lower case equivalent.

>>> toCase UpperCase SmallLetterX
CapitalLetterX
>>> toCase LowerCase CapitalLetterF
SmallLetterF

Characters that are already in the requested case are unmodified by this transformation.

>>> toCase UpperCase CapitalLetterA
CapitalLetterA

Characters that are not letters, such as exclamation mark, are unmodified by this transformation.

>>> toCase UpperCase ExclamationMark
ExclamationMark