@@ -1,6 +1,6 @@
2-- Module : Text.Inflections
2-- Module : Text.Inflections
3−-- Description : Rails-like inflections library for common String transformations.
3+-- Description : Rails-like inflections library for common Text transformations.
4-- Copyright : (c) Justin Leitgeb
4-- Copyright : (c) Justin Leitgeb
5-- License : MIT
5-- License : MIT
@@ -8,7 +8,7 @@
8-- Stability : unstable
8-- Stability : unstable
9-- Portability : portable
9-- Portability : portable
11−-- This module provides methods for common String transformations, similar
11+-- This module provides methods for common 'Text' transformations, similar
12-- to the Inflections library found in Rails:
12-- to the Inflections library found in Rails:
14-- <http://api.rubyonrails.org/classes/ActiveSupport/Inflector.html>
14-- <http://api.rubyonrails.org/classes/ActiveSupport/Inflector.html>
@@ -17,7 +17,7 @@
17-- implementations in Rails' ActiveSupport, the philosophy of this library
17-- implementations in Rails' ActiveSupport, the philosophy of this library
18-- is fundamentally different. Where Rails tries to be as permissive as
18-- is fundamentally different. Where Rails tries to be as permissive as
19-- possible, and return a String when given any input, this library tries to
19-- possible, and return a String when given any input, this library tries to
20−-- output strings that make sense according to the function that is called.
20+-- output 'Text' that makes sense according to the function that is called.
22-- When you look closely at many of the functions in Rails' inflections
22-- When you look closely at many of the functions in Rails' inflections
23-- library, you will notice that many of them are partial. That is, they
23-- library, you will notice that many of them are partial. That is, they
@@ -33,7 +33,7 @@
33-- >>> "foo bar".underscore
33-- >>> "foo bar".underscore
34-- "foo bar"
34-- "foo bar"
36−-- The output isn't underscored - it contains a space! It turns out that
36+-- The output isn't underscored — it contains a space! It turns out that
37-- some of the functions from Inflections in ActiveSupport are /partial/.
37-- some of the functions from Inflections in ActiveSupport are /partial/.
38-- I.e., the outputs are really only specified for a certain range of the
38-- I.e., the outputs are really only specified for a certain range of the
39-- inputs allowed by the String type.
39-- inputs allowed by the String type.
@@ -42,7 +42,7 @@
42-- results by separating the parsing of strings into tokens from the
42-- results by separating the parsing of strings into tokens from the
43-- application of transformations. Let's see an example.
43-- application of transformations. Let's see an example.
45−-- First, we tokenize an underscored String using 'parseSnakeCase':
45+-- First, we tokenize an underscored 'Text' using 'parseSnakeCase':
47-- >>> parseSnakeCase [] "foo_bar"
47-- >>> parseSnakeCase [] "foo_bar"
48-- Right [Word "foo",Word "bar"]
48-- Right [Word "foo",Word "bar"]
@@ -79,8 +79,17 @@
79{-# LANGUAGE CPP #-}
79{-# LANGUAGE CPP #-}
81module Text.Inflections
81module Text.Inflections
82+ ( -- * Types and helpers
90+ , InflectionException (..)
82− ( -- * Parsing
91+ -- * Parsing
83− parseSnakeCase
92+ , parseSnakeCase
84 , parseCamelCase
93 , parseCamelCase
85 -- * Rendering
94 -- * Rendering
86 , camelize
95 , camelize
@@ -97,15 +106,6 @@ module Text.Inflections
97 , transliterateCustom
106 , transliterateCustom
98 , ordinalize
107 , ordinalize
99 , ordinal
108 , ordinal
100− -- * Types and helpers
108− , InflectionException (..)
109 -- * Often used combinators
109 -- * Often used combinators
110 , toUnderscore
110 , toUnderscore
111 , toDashed
111 , toDashed