inflections-0.1.0.3: Inflections library for Haskell

Safe HaskellSafe-Inferred

Text.Inflections

Synopsis

Documentation

camelizeSource

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.

camelizeCustomSource

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.

dasherizeSource

Arguments

:: String

The input string, in snake_case

-> Either ParseError String 

Replaces underscores in a snake_cased string with dashes (hyphens).

dasherizeCustomSource

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.

underscoreSource

Arguments

:: String

A String in CamelCase

-> Either ParseError String 

Turns a CamelCase string into an underscore_separated String.

underscoreCustomSource

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 :: 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.