Safe Haskell | None |
---|---|
Language | Haskell2010 |
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.
- newtype Titlecase = Titlecase {
- unTitlecase :: Text
- newtype Article = Article {
- unArticle :: Text
- newtype Conjunction = Conjunction {
- unConjunction :: Text
- data Preposition
- = OneWordPreposition Text
- | TwoWordPreposition Text Text
- | ThreeWordPreposition Text Text Text
- | FourWordPreposition Text Text Text Text
- toTitle :: Text -> Text
- (<#>) :: Text -> Text -> Text
- uncurry3 :: (a -> b -> c -> d) -> (a, b, c) -> d
- uncurry4 :: (a -> b -> c -> d -> e) -> (a, b, c, d) -> e
- isElem :: (a -> Text) -> NonEmpty a -> Text -> Bool
- isArticle :: Text -> Bool
- isOneWordPreposition :: Text -> Bool
- isConjunction :: Text -> Bool
- isTwoWordPreposition :: Text -> Text -> Bool
- isThreeWordPreposition :: Text -> Text -> Text -> Bool
- isFourWordPreposition :: Text -> Text -> Text -> Text -> Bool
- unPreposition :: Preposition -> Text
- articles :: NonEmpty Article
- conjunctions :: NonEmpty Conjunction
- prepositions :: NonEmpty Preposition
- oneWordPrepositions :: NonEmpty Preposition
- twoWordPrepositions :: NonEmpty Preposition
- threeWordPrepositions :: NonEmpty Preposition
- fourWordPrepositions :: NonEmpty Preposition
Types
Titlecase | |
|
data Preposition Source
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
.
isOneWordPreposition :: Text -> Bool Source
isConjunction :: Text -> Bool Source
isTwoWordPreposition :: Text -> Text -> Bool Source
isThreeWordPreposition :: Text -> Text -> Text -> Bool Source
isFourWordPreposition :: Text -> Text -> Text -> Text -> Bool Source
unPreposition :: Preposition -> Text Source
Words that are capitalized only when they start or end a title
conjunctions :: NonEmpty Conjunction Source
prepositions :: NonEmpty Preposition Source
oneWordPrepositions :: NonEmpty Preposition Source
twoWordPrepositions :: NonEmpty Preposition Source
threeWordPrepositions :: NonEmpty Preposition Source
fourWordPrepositions :: NonEmpty Preposition Source