Safe Haskell | None |
---|---|
Language | Haskell2010 |
Generalizes all the data needed to make code generation work with arbitrary programming languages.
- class HasForeign layout where
- type Foreign layout :: *
- foreignFor :: Proxy layout -> Req -> Foreign layout
- newtype Segment = Segment {}
- data SegmentType
- type FunctionName = [Text]
- data QueryArg = QueryArg {}
- data HeaderArg
- = HeaderArg {
- headerArgName :: Text
- | ReplaceHeaderArg {
- headerArgName :: Text
- headerPattern :: Text
- = HeaderArg {
- data ArgType
- data Req
- captureArg :: Segment -> Arg
- defReq :: Req
- concatCase :: FunctionName -> Text
- snakeCase :: FunctionName -> Text
- camelCase :: FunctionName -> Text
- argType :: Lens' QueryArg ArgType
- argName :: Lens' QueryArg Arg
- isCapture :: Segment -> Bool
- funcName :: Lens' Req FunctionName
- path :: Lens' Url Path
- reqUrl :: Lens' Req Url
- reqBody :: Lens' Req Bool
- reqHeaders :: Lens' Req [HeaderArg]
- reqMethod :: Lens' Req Method
- segment :: Iso' Segment SegmentType
- queryStr :: Lens' Url [QueryArg]
- module Servant.API
Documentation
class HasForeign layout where
type Foreign layout :: *
foreignFor :: Proxy layout -> Req -> Foreign layout
HasForeign Raw | |
(HasForeign a, HasForeign b) => HasForeign ((:<|>) a b) | |
Elem JSON list => HasForeign (Get list a) | |
Elem JSON list => HasForeign (Post list a) | |
Elem JSON list => HasForeign (Delete list a) | |
Elem JSON list => HasForeign (Put list a) | |
(KnownSymbol sym, HasForeign sublayout) => HasForeign ((:>) * * (Capture * sym a) sublayout) | |
(KnownSymbol sym, HasForeign sublayout) => HasForeign ((:>) * * (Header sym a) sublayout) | |
HasForeign sublayout => HasForeign ((:>) * * HttpVersion sublayout) | |
(KnownSymbol sym, HasForeign sublayout) => HasForeign ((:>) * * (QueryParam * sym a) sublayout) | |
(KnownSymbol sym, HasForeign sublayout) => HasForeign ((:>) * * (QueryParams * sym a) sublayout) | |
(KnownSymbol sym, HasForeign sublayout) => HasForeign ((:>) * * (QueryFlag sym) sublayout) | |
(Elem JSON list, HasForeign sublayout) => HasForeign ((:>) * * (ReqBody * list a) sublayout) | |
HasForeign sublayout => HasForeign ((:>) * * RemoteHost sublayout) | |
HasForeign sublayout => HasForeign ((:>) * * IsSecure sublayout) | |
HasForeign sublayout => HasForeign ((:>) * * Vault sublayout) | |
(KnownSymbol path, HasForeign sublayout) => HasForeign ((:>) Symbol * path sublayout) |
data SegmentType
Eq SegmentType | |
Show SegmentType |
type FunctionName = [Text]
data HeaderArg
HeaderArg | |
| |
ReplaceHeaderArg | |
|
captureArg :: Segment -> Arg
concatCase :: FunctionName -> Text
Function name builder that simply concat each part together
snakeCase :: FunctionName -> Text
Function name builder using the snake_case convention. each part is separated by a single underscore character.
camelCase :: FunctionName -> Text
Function name builder using the CamelCase convention. each part begins with an upper case character.
funcName :: Lens' Req FunctionName
path :: Lens' Url Path
reqHeaders :: Lens' Req [HeaderArg]
segment :: Iso' Segment SegmentType
module Servant.API