@@ -47,6 +47,7 @@ module Servant.Foreign
4747 ) where
4848
4949import Control.Lens (makeLenses, (%~), (&), (.~), (<>~))
50+import qualified Data.Char as C
5051import Data.Proxy
5152import Data.Text
5253import GHC.Exts (Constraint)
@@ -66,10 +67,11 @@ snakeCase = intercalate "_"
6667-- | Function name builder using the CamelCase convention.
6768-- each part begins with an upper case character.
6869camelCase :: FunctionName -> Text
69−camelCase [] = ""
70−camelCase (p:ps) = concat $ p : camelCase' ps
71− where camelCase' [] = []
72− camelCase' (r:rs) = toUpper r : camelCase' rs
70+camelCase = camelCase' . Prelude.map (replace "-" "")
71+ where camelCase' [] = ""
72+ camelCase' (p:ps) = concat $ p : Prelude.map capitalize ps
73+ capitalize "" = ""
74+ capitalize name = C.toUpper (Data.Text.head name) `cons` Data.Text.tail name
7375
7476type Arg = Text
7577