@@ -20,20 +20,31 @@ import Prelude hiding
2020 (head, tail)
2121import Servant.Foreign.Internal
2222
23+-- | Simply concat each part of the FunctionName together.
24+--
25+-- @[ "get", "documents", "by", "id" ] → "getdocumentsbyid"@
26+concatCase :: FunctionName -> Text
27+concatCase = view concatCaseL
28+
2329concatCaseL :: Getter FunctionName Text
2430concatCaseL = _FunctionName . to mconcat
2531
26−-- | Function name builder that simply concat each part together
27−concatCase :: FunctionName -> Text
28−concatCase = view concatCaseL
32+-- | Use the snake_case convention.
33+-- Each part is separated by a single underscore character.
34+--
35+-- @[ "get", "documents", "by", "id" ] → "get_documents_by_id"@
36+snakeCase :: FunctionName -> Text
37+snakeCase = view snakeCaseL
2938
3039snakeCaseL :: Getter FunctionName Text
3140snakeCaseL = _FunctionName . to (intercalate "_")
3241
33−-- | Function name builder using the snake_case convention.
34−-- each part is separated by a single underscore character.
35−snakeCase :: FunctionName -> Text
36−snakeCase = view snakeCaseL
42+-- | Use the camelCase convention.
43+-- The first part is lower case, every other part starts with an upper case character.
44+--
45+-- @[ "get", "documents", "by", "id" ] → "getDocumentsById"@
46+camelCase :: FunctionName -> Text
47+camelCase = view camelCaseL
3748
3849camelCaseL :: Getter FunctionName Text
3950camelCaseL = _FunctionName . to convert
@@ -42,8 +53,3 @@ camelCaseL = _FunctionName . to convert
4253 convert (p:ps) = mconcat $ p : map capitalize ps
4354 capitalize "" = ""
4455 capitalize name = C.toUpper (head name) `cons` tail name
45−
46−-- | Function name builder using the CamelCase convention.
47−-- each part begins with an upper case character.
48−camelCase :: FunctionName -> Text
49−camelCase = view camelCaseL