Safe Haskell | Safe-Inferred |
---|
Text.Inflections
- camelize :: String -> Either ParseError String
- camelizeCustom :: [String] -> Bool -> String -> Either ParseError String
- dasherize :: String -> Either ParseError String
- dasherizeCustom :: [String] -> String -> Either ParseError String
- underscore :: String -> Either ParseError String
- underscoreCustom :: [String] -> String -> Either ParseError String
- defaultMap :: Map Char String
- parameterize :: String -> String
- parameterizeCustom :: Transliterations -> String -> String
- transliterate :: String -> String
- transliterateCustom :: String -> Transliterations -> String -> String
- ordinal :: Integer -> String
- ordinalize :: Integer -> String
Documentation
Arguments
:: String | The input string, in snake_case |
-> Either ParseError String |
Turns a String in snake_case into CamelCase. Returns the CamelCase string, or a ParseError if the input String is not in valid snake_case.
Arguments
:: [String] | A list of acronyms that will be kept whole and accepted as valid input |
-> Bool | Whether to capitalize the first character in the output String |
-> String | The input string, in snake_case |
-> Either ParseError String |
Turns an input String in snake_case into CamelCase. Returns the CamelCase String, or a ParseError if the input String is not in valid snake_case. Accepts arguments to control parsing and output format.
Arguments
:: String | The input string, in snake_case |
-> Either ParseError String |
Replaces underscores in a snake_cased string with dashes (hyphens).
Arguments
:: [String] | A list of acronyms that will be kept whole and accepted as valid input |
-> String | The input string, in snake_case |
-> Either ParseError String |
Turns a snake_case string into dasherized form. Returns a ParseError if the input string is not in proper snake_case.
Arguments
:: String | A String in CamelCase |
-> Either ParseError String |
Turns a CamelCase string into an underscore_separated String.
Arguments
:: [String] | A list of acronyms that will be kept whole and accepted as valid input |
-> String | A String in CamelCase |
-> Either ParseError String |
Changes an input String in CamelCase into a String of Words separated by underscores. Accepts options for customization.
defaultMap :: Map Char StringSource
These default transliterations stolen from the Ruby i18n library - https:github.comsvenfuchsi18nblobmasterlibi18nbackendtransliterator.rb#L41:L69
parameterize :: String -> StringSource
Replaces special characters in a string so that it may be used as part of a
pretty
URL. Uses the default transliterations in this library
parameterizeCustom :: Transliterations -> String -> StringSource
Transliterate a String with a custom transliteration table.
transliterate :: String -> StringSource
Returns a String after default approximations for changing Unicode characters to a valid ASCII range are applied. If you want to supplement the default approximations with your own, you should use the transliterateCustom function instead of transliterate.
transliterateCustom :: String -> Transliterations -> String -> StringSource
Returns a String after default approximations for changing Unicode characters to a valid ASCII range are applied.
ordinal :: Integer -> StringSource
Returns the suffix that should be added to a number to denote the position in an ordered sequence such as 1st, 2nd, 3rd, 4th.
ordinalize :: Integer -> StringSource
Turns a number into an ordinal string used to denote the position in an ordered sequence such as 1st, 2nd, 3rd, 4th.