titlecase-0.1.0.1: Convert English words to title case

Safe HaskellNone
LanguageHaskell2010

Data.Text.Titlecase.Internal

Contents

Description

As the name implies, this module is meant to be used only if you want to get access to the internals, say, if you're unhappy with the provided titlecase function. Data.Text.Titlecase.Internal doesn't prevent you from creating improperly capitalized Titlecase values. In any other case, Data.Text.Titlecase is what you're looking for.

Synopsis

Types

newtype Titlecase Source

Constructors

Titlecase 

Fields

unTitlecase :: Text
 

Instances

newtype Article Source

Constructors

Article 

Fields

unArticle :: Text
 

Instances

newtype Conjunction Source

Constructors

Conjunction 

Fields

unConjunction :: Text
 

data Preposition Source

Constructors

OneWordPreposition Text 
TwoWordPreposition Text Text 
ThreeWordPreposition Text Text Text 
FourWordPreposition Text Text Text Text 

Helpers

toTitle :: Text -> Text Source

Capitalize the first character. Note that this function behaves differently than toTitle.

(<#>) :: Text -> Text -> Text Source

uncurry3 :: (a -> b -> c -> d) -> (a, b, c) -> d Source

uncurry4 :: (a -> b -> c -> d -> e) -> (a, b, c, d) -> e Source

isElem :: (a -> Text) -> NonEmpty a -> Text -> Bool Source

isArticle :: Text -> Bool Source

isTwoWordPreposition :: Text -> Text -> Bool Source

isThreeWordPreposition :: Text -> Text -> Text -> Bool Source

isFourWordPreposition :: Text -> Text -> Text -> Text -> Bool Source

Words that are capitalized only when they start or end a title

articles :: NonEmpty Article Source