Module documentation for 0.2.0.0

String Inflections for Haskell

This library is a partial port of the
String Inflector
from Ruby on Rails. It currently implements methods such as parameterize,
transliterate, camelize, underscore and dasherize. Please see the
haddock documentation for a complete list of the functions implemented by this
library.

Unlike the ActiveSupport (Rails) and Ember implementations of inflections, this
library uses a parser to verify the input to functions like camelize. This is
done to ensure that the output strings adhere to the syntax that they are
supposed to generate. You can read more about the philosophy behind this library
in the
Haddock documentation.

Usage

The following examples demonstrate usage of the parameterize, transliterate
and camelize functions:

Customization

Part of parameterizing strings is approximating all characters in the input
encoding to ASCII characters. This library copies the character approximation
table from the Ruby i18n library. This data structure is provided as
defaultCharacterTransliterations. You can provide your own transliteration map
by passing a Map structure (from Data.Map) to the parameterizeCustom function.

If you want to specify a custom default replacement or approximation table for
the transliterate function, you should instead call the transliterateCustom
function which accepts a String for replacements and a Map for substitution.

TODO

I'd like this library to implement other functions found in the Rails
inflections library. If you need one of those functions, please submit a pull
request!

Inflections 0.4.0.2

Inflections 0.4.0.1

Inflections 0.4.0.0

Inflections 0.3.0.0

Made the API use Text instead of String (which significally improved
speed).

Switched to Megaparsec 5 for parsing.

Renamed defaultMap to defaultTransliterations.

Words now can contain digits (recognized by all parsers).

parseSnakeCase now is not confused when a word happens to have prefix
coinciding with an acronym. This is harder to fix for parseCamelCase
because acronym may contain capital letters, so old behavior is preserved
for parseCamelCase for now.

parseCamelCase and parseSnakeCase take any instance of Foldable as a
collection of acronyms, not just lists.

Added the CHANGELOG.md file.

Switched test suite to Hspec.

The toUnderscore, toDashed, and toCamelCased are not partial
anymore. They return parse error in Left just like parsing functions,
but this result can be lifted into any instance of MonadThrow with
betterThrow helper.