@@ -21,8 +21,6 @@ module Servant.Foreign
2121 , HeaderArg(..)
2222 , ArgType(..)
2323 , Req
24− , CommonGeneratorOptions(..)
25− , defCommonGeneratorOptions
2624 , toValidFunctionName
2725 , captureArg
2826 , defReq
@@ -60,41 +58,6 @@ import GHC.Exts (Constraint)
6058import GHC.TypeLits
6159import Servant.API
6260
63−-- | This structure is used by specific implementations to let you
64−-- customize the output
65−data CommonGeneratorOptions = CommonGeneratorOptions
66− {
67− functionNameBuilder :: FunctionName -> String -- ^ function generating function names
68− , requestBody :: String -- ^ name used when a user want to send the request body (to let you redefine it)
69− , successCallback :: String -- ^ name of the callback parameter when the request was successful
70− , errorCallback :: String -- ^ name of the callback parameter when the request reported an error
71− , moduleName :: String -- ^ namespace on which we define the foreign function (empty mean local var)
72− , urlPrefix :: String -- ^ a prefix we should add to the Url in the codegen
73− }
74−
75−-- | Default options.
76−--
77−-- @
78−-- > defCommonGeneratorOptions = CommonGeneratorOptions
79−-- > { functionNameBuilder = camelCase
80−-- > , requestBody = "body"
81−-- > , successCallback = "onSuccess"
82−-- > , errorCallback = "onError"
83−-- > , moduleName = ""
84−-- > , urlPrefix = ""
85−-- > }
86−-- @
87−defCommonGeneratorOptions :: CommonGeneratorOptions
88−defCommonGeneratorOptions = CommonGeneratorOptions
89− {
90− functionNameBuilder = camelCase
91− , requestBody = "body"
92− , successCallback = "onSuccess"
93− , errorCallback = "onError"
94− , moduleName = ""
95− , urlPrefix = ""
96− }
97−
9861-- | Function name builder that simply concat each part together
9962concatCase :: FunctionName -> String
10063concatCase = concat
@@ -233,7 +196,6 @@ defReq :: Req
233196defReq = Req defUrl "GET" [] False []
234197
235198type family Elem (a :: *) (ls::[*]) :: Constraint where
236− Elem a '[] = 'False ~ 'True
237199 Elem a (a ': list) = ()
238200 Elem a (b ': list) = Elem a list
239201