a0265097e8
The imports were ordered in the worst possible way, with all undocumented small type definitions coming first and the actual meat of the module coming at the very end, mixed in with irrelevant functions. This inverses that toxic ordering, showing the main function first (`listFromAPI`) and then the main data type (`Req`) and the main class (`HasForeignType`).
59 lines
1.2 KiB
Haskell
59 lines
1.2 KiB
Haskell
-- | Generalizes all the data needed to make code generation work with
|
|
-- arbitrary programming languages.
|
|
--
|
|
-- See documentation of 'HasForeignType' for a simple example. 'listFromAPI' returns a list of all your endpoints and their foreign types, given a mapping from Haskell types to foreign types (conventionally called `ftypes` below).
|
|
module Servant.Foreign
|
|
( listFromAPI
|
|
, Req(..)
|
|
, defReq
|
|
, HasForeignType(..)
|
|
, GenerateList(..)
|
|
, HasForeign(..)
|
|
, NoTypes
|
|
, ArgType(..)
|
|
, HeaderArg(..)
|
|
, QueryArg(..)
|
|
, ReqBodyContentType(..)
|
|
, Segment(..)
|
|
, isCapture
|
|
, captureArg
|
|
, SegmentType(..)
|
|
, Url(..)
|
|
-- * aliases
|
|
, Path
|
|
, Arg(..)
|
|
, FunctionName(..)
|
|
, PathSegment(..)
|
|
-- * lenses
|
|
, argName
|
|
, argType
|
|
, argPath
|
|
, reqUrl
|
|
, reqMethod
|
|
, reqHeaders
|
|
, reqBody
|
|
, reqBodyContentType
|
|
, reqReturnType
|
|
, reqFuncName
|
|
, path
|
|
, queryStr
|
|
, queryArgName
|
|
, queryArgType
|
|
, headerArg
|
|
-- * prisms
|
|
, _PathSegment
|
|
, _HeaderArg
|
|
, _ReplaceHeaderArg
|
|
, _Static
|
|
, _Cap
|
|
, _Normal
|
|
, _Flag
|
|
, _List
|
|
-- * re-exports
|
|
, module Servant.API
|
|
, module Servant.Foreign.Inflections
|
|
) where
|
|
|
|
import Servant.API
|
|
import Servant.Foreign.Inflections
|
|
import Servant.Foreign.Internal
|