@@ -111,6 +111,7 @@ module Text.Inflections
111 , toUnderscore
111 , toUnderscore
112 , toDashed
112 , toDashed
113 , toCamelCased
113 , toCamelCased
114 , betterThrow )
115 , betterThrow )
@@ -153,20 +154,39 @@ toDashed :: Text -> Either (ParseError Char Dec) Text
153toDashed = fmap dasherize . parseCamelCase []
154toDashed = fmap dasherize . parseCamelCase []
155-- | Transforms underscored_text to CamelCasedText. If first argument is
156-- | Transforms underscored_text to CamelCasedText. If first argument is
156−-- 'True' then FirstCharacter in result string will be in upper case. If
157+-- 'True' then the first character in the result string will be in upper case. If
157−-- 'False' then firstCharacter will be in lower case.
158+-- 'False' then the first character will be in lower case.
159−-- > toCamelCased t = fmap (camelizeCustom t) . parseSnakeCase []
160+-- > toCamelCased c = fmap (camelizeCustom c) . parseSnakeCase []
161-- >>> toCamelCased True "foo_bar_bazz"
162-- >>> toCamelCased True "foo_bar_bazz"
162-- "FooBarBazz"
163-- "FooBarBazz"
163-- >>> toCamelCased False "foo_bar_bazz"
164-- >>> toCamelCased False "foo_bar_bazz"
164-- "fooBarBazz"
165-- "fooBarBazz"
165toCamelCased
166toCamelCased
166− :: Bool -- ^ Capitalize the first character
167+ :: Bool -- ^ Capitalize the first character
167− -> Text -- ^ Input
168+ -> Text -- ^ Input
168− -> Either (ParseError Char Dec) Text -- ^ Ouput
169+ -> Either (ParseError Char Dec) Text -- ^ Output
169−toCamelCased t = fmap (camelizeCustom t) . parseSnakeCase []
170+toCamelCased c = fmap (camelizeCustom c) . parseSnakeCase []
172+-- | Transforms underscored_text to space-separated human-readable text.
173+-- If first argument is 'True' then the first character in the result
174+-- string will be in upper case. If 'False' then the first character will be
177+-- > toHumanized c = fmap (humanizeCustom c) . parseSnakeCase []
179+-- >>> toHumanized True "foo_bar_bazz"
181+-- >>> toHumanized False "foo_bar_bazz"
186+ :: Bool -- ^ Capitalize the first character
188+ -> Either (ParseError Char Dec) Text -- ^ Output
189+toHumanized c = fmap (humanizeCustom c) . parseSnakeCase []
171-- | Lift something of type @'Either' ('ParseError' 'Char' 'Dec') a@ to
191-- | Lift something of type @'Either' ('ParseError' 'Char' 'Dec') a@ to
172-- an instance of 'MonadThrow'. Useful when you want to shortcut on parsing
192-- an instance of 'MonadThrow'. Useful when you want to shortcut on parsing