@@ -21,8 +21,6 @@ module Servant.Foreign
21 , HeaderArg(..)
21 , HeaderArg(..)
22 , ArgType(..)
22 , ArgType(..)
24− , CommonGeneratorOptions(..)
25− , defCommonGeneratorOptions
26 , toValidFunctionName
24 , toValidFunctionName
27 , captureArg
25 , captureArg
@@ -60,41 +58,6 @@ import GHC.Exts (Constraint)
60import GHC.TypeLits
58import GHC.TypeLits
61import Servant.API
59import Servant.API
63−-- | This structure is used by specific implementations to let you
64−-- customize the output
65−data CommonGeneratorOptions = CommonGeneratorOptions
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
78−-- > defCommonGeneratorOptions = CommonGeneratorOptions
79−-- > { functionNameBuilder = camelCase
80−-- > , requestBody = "body"
81−-- > , successCallback = "onSuccess"
82−-- > , errorCallback = "onError"
83−-- > , moduleName = ""
87−defCommonGeneratorOptions :: CommonGeneratorOptions
88−defCommonGeneratorOptions = CommonGeneratorOptions
90− functionNameBuilder = camelCase
91− , requestBody = "body"
92− , successCallback = "onSuccess"
93− , errorCallback = "onError"
98-- | Function name builder that simply concat each part together
61-- | Function name builder that simply concat each part together
99concatCase :: FunctionName -> String
62concatCase :: FunctionName -> String
100concatCase = concat
63concatCase = concat
@@ -233,7 +196,6 @@ defReq :: Req
233defReq = Req defUrl "GET" [] False []
196defReq = Req defUrl "GET" [] False []
235type family Elem (a :: *) (ls::[*]) :: Constraint where
198type family Elem (a :: *) (ls::[*]) :: Constraint where
236− Elem a '[] = 'False ~ 'True
237 Elem a (a ': list) = ()
199 Elem a (a ': list) = ()
238 Elem a (b ': list) = Elem a list
200 Elem a (b ': list) = Elem a list