Copyright | (c) Abhinav Gupta 2015 |
---|---|
License | BSD3 |
Maintainer | Abhinav Gupta <mail@abhinavg.net> |
Stability | experimental |
Safe Haskell | None |
Language | Haskell2010 |
This module defines types that compose a Thrift IDL file.
Most of the types have an optional srcAnnot
parameter that represents a
parser-specific source annotation. With trifecta
this can hold the
Delta
. If you do not have need of this, you can use
()
as the parameter.
- data Program srcAnnot = Program {
- programHeaders :: [Header srcAnnot]
- programDefinitions :: [Definition srcAnnot]
- data Header srcAnnot
- = HeaderInclude (Include srcAnnot)
- | HeaderNamespace (Namespace srcAnnot)
- _Include :: Prism' (Header ann) (Include ann)
- _Namespace :: Prism' (Header ann) (Namespace ann)
- data Include srcAnnot = Include {
- includePath :: Text
- includeSrcAnnot :: srcAnnot
- data Namespace srcAnnot = Namespace {
- namespaceLanguage :: Text
- namespaceName :: Text
- namespaceSrcAnnot :: srcAnnot
- data Definition srcAnnot
- = ConstDefinition (Const srcAnnot)
- | TypeDefinition (Type srcAnnot)
- | ServiceDefinition (Service srcAnnot)
- _Const :: Prism' (Definition ann) (Const ann)
- _Service :: Prism' (Definition ann) (Service ann)
- _Type :: Prism' (Definition ann) (Type ann)
- data Const srcAnnot = Const {
- constValueType :: TypeReference srcAnnot
- constName :: Text
- constValue :: ConstValue srcAnnot
- constDocstring :: Docstring
- constSrcAnnot :: srcAnnot
- data Service srcAnnot = Service {
- serviceName :: Text
- serviceExtends :: Maybe Text
- serviceFunctions :: [Function srcAnnot]
- serviceAnnotations :: [TypeAnnotation]
- serviceDocstring :: Docstring
- serviceSrcAnnot :: srcAnnot
- data Type srcAnnot
- = TypedefType (Typedef srcAnnot)
- | EnumType (Enum srcAnnot)
- | StructType (Struct srcAnnot)
- | UnionType (Union srcAnnot)
- | ExceptionType (Exception srcAnnot)
- | SenumType (Senum srcAnnot)
- _Typedef :: Prism' (Type ann) (Typedef ann)
- _Enum :: Prism' (Type ann) (Enum ann)
- _Struct :: Prism' (Type ann) (Struct ann)
- _Union :: Prism' (Type ann) (Union ann)
- _Exception :: Prism' (Type ann) (Exception ann)
- _Senum :: Prism' (Type ann) (Senum ann)
- data Typedef srcAnnot = Typedef {
- typedefTargetType :: TypeReference srcAnnot
- typedefName :: Text
- typedefAnnotations :: [TypeAnnotation]
- typedefDocstring :: Docstring
- typedefSrcAnnot :: srcAnnot
- data Enum srcAnnot = Enum {
- enumName :: Text
- enumValues :: [EnumDef srcAnnot]
- enumAnnotations :: [TypeAnnotation]
- enumDocstring :: Docstring
- enumSrcAnnot :: srcAnnot
- data Struct srcAnnot = Struct {
- structName :: Text
- structFields :: [Field srcAnnot]
- structAnnotations :: [TypeAnnotation]
- structDocstring :: Docstring
- structSrcAnnot :: srcAnnot
- data Union srcAnnot = Union {
- unionName :: Text
- unionFields :: [Field srcAnnot]
- unionAnnotations :: [TypeAnnotation]
- unionDocstring :: Docstring
- unionSrcAnnot :: srcAnnot
- data Exception srcAnnot = Exception {
- exceptionName :: Text
- exceptionFields :: [Field srcAnnot]
- exceptionAnnotations :: [TypeAnnotation]
- exceptionDocstring :: Docstring
- exceptionSrcAnnot :: srcAnnot
- data Senum srcAnnot = Senum {
- senumName :: Text
- senumValues :: [Text]
- senumAnnotations :: [TypeAnnotation]
- senumDocstring :: Docstring
- senumSrcAnnot :: srcAnnot
- data FieldRequiredness
- _Required :: Prism' FieldRequiredness ()
- _Optional :: Prism' FieldRequiredness ()
- data Field srcAnnot = Field {
- fieldIdentifier :: Maybe Integer
- fieldRequiredness :: Maybe FieldRequiredness
- fieldValueType :: TypeReference srcAnnot
- fieldName :: Text
- fieldDefaultValue :: Maybe (ConstValue srcAnnot)
- fieldAnnotations :: [TypeAnnotation]
- fieldDocstring :: Docstring
- fieldSrcAnnot :: srcAnnot
- data EnumDef srcAnnot = EnumDef {
- enumDefName :: Text
- enumDefValue :: Maybe Integer
- enumDefAnnotations :: [TypeAnnotation]
- enumDefDocstring :: Docstring
- enumDefSrcAnnot :: srcAnnot
- data ConstValue srcAnnot
- = ConstInt Integer
- | ConstFloat Double
- | ConstLiteral Text
- | ConstIdentifier Text srcAnnot
- | ConstList [ConstValue srcAnnot]
- | ConstMap [(ConstValue srcAnnot, ConstValue srcAnnot)]
- _ConstInt :: forall srcAnnot. Prism' (ConstValue srcAnnot) Integer
- _ConstFloat :: forall srcAnnot. Prism' (ConstValue srcAnnot) Double
- _ConstLiteral :: forall srcAnnot. Prism' (ConstValue srcAnnot) Text
- _ConstIdentifier :: forall srcAnnot. Prism' (ConstValue srcAnnot) (Text, srcAnnot)
- _ConstList :: forall srcAnnot. Prism' (ConstValue srcAnnot) [ConstValue srcAnnot]
- _ConstMap :: forall srcAnnot. Prism' (ConstValue srcAnnot) [(ConstValue srcAnnot, ConstValue srcAnnot)]
- data TypeReference srcAnnot
- = DefinedType Text srcAnnot
- | StringType [TypeAnnotation]
- | BinaryType [TypeAnnotation]
- | SListType [TypeAnnotation]
- | BoolType [TypeAnnotation]
- | ByteType [TypeAnnotation]
- | I16Type [TypeAnnotation]
- | I32Type [TypeAnnotation]
- | I64Type [TypeAnnotation]
- | DoubleType [TypeAnnotation]
- | MapType (TypeReference srcAnnot) (TypeReference srcAnnot) [TypeAnnotation]
- | SetType (TypeReference srcAnnot) [TypeAnnotation]
- | ListType (TypeReference srcAnnot) [TypeAnnotation]
- _DefinedType :: forall srcAnnot. Prism' (TypeReference srcAnnot) (Text, srcAnnot)
- _StringType :: forall srcAnnot. Prism' (TypeReference srcAnnot) [TypeAnnotation]
- _BinaryType :: forall srcAnnot. Prism' (TypeReference srcAnnot) [TypeAnnotation]
- _SListType :: forall srcAnnot. Prism' (TypeReference srcAnnot) [TypeAnnotation]
- _BoolType :: forall srcAnnot. Prism' (TypeReference srcAnnot) [TypeAnnotation]
- _ByteType :: forall srcAnnot. Prism' (TypeReference srcAnnot) [TypeAnnotation]
- _I16Type :: forall srcAnnot. Prism' (TypeReference srcAnnot) [TypeAnnotation]
- _I32Type :: forall srcAnnot. Prism' (TypeReference srcAnnot) [TypeAnnotation]
- _I64Type :: forall srcAnnot. Prism' (TypeReference srcAnnot) [TypeAnnotation]
- _DoubleType :: forall srcAnnot. Prism' (TypeReference srcAnnot) [TypeAnnotation]
- _MapType :: forall srcAnnot. Prism' (TypeReference srcAnnot) (TypeReference srcAnnot, TypeReference srcAnnot, [TypeAnnotation])
- _SetType :: forall srcAnnot. Prism' (TypeReference srcAnnot) (TypeReference srcAnnot, [TypeAnnotation])
- _ListType :: forall srcAnnot. Prism' (TypeReference srcAnnot) (TypeReference srcAnnot, [TypeAnnotation])
- data Function srcAnnot = Function {
- functionOneWay :: Bool
- functionReturnType :: Maybe (TypeReference srcAnnot)
- functionName :: Text
- functionParameters :: [Field srcAnnot]
- functionExceptions :: Maybe [Field srcAnnot]
- functionAnnotations :: [TypeAnnotation]
- functionDocstring :: Docstring
- functionSrcAnnot :: srcAnnot
- data TypeAnnotation = TypeAnnotation {}
- type Docstring = Maybe Text
- class HasAnnotations s a | s -> a where
- annotations :: Lens' s a
- class HasDefaultValue s a | s -> a where
- defaultValue :: Lens' s a
- class HasDefinitions s a | s -> a where
- definitions :: Lens' s a
- class HasDocstring s a | s -> a where
- class HasExceptions s a | s -> a where
- exceptions :: Lens' s a
- class HasExtends s a | s -> a where
- class HasFields s a | s -> a where
- class HasFunctions s a | s -> a where
- class HasHeaders s a | s -> a where
- class HasIdentifier s a | s -> a where
- identifier :: Lens' s a
- class HasLanguage s a | s -> a where
- class HasName s a | s -> a where
- class HasOneWay s a | s -> a where
- class HasParameters s a | s -> a where
- parameters :: Lens' s a
- class HasPath s a | s -> a where
- class HasRequiredness s a | s -> a where
- requiredness :: Lens' s a
- class HasReturnType s a | s -> a where
- returnType :: Lens' s a
- class HasSrcAnnot s a | s -> a where
- class HasTargetType s a | s -> a where
- targetType :: Lens' s a
- class HasValue s a | s -> a where
- class HasValues s a | s -> a where
- class HasValueType s a | s -> a where
Documentation
A program represents a single Thrift document.
Program | |
|
Eq srcAnnot => Eq (Program srcAnnot) Source | |
Data srcAnnot => Data (Program srcAnnot) Source | |
Ord srcAnnot => Ord (Program srcAnnot) Source | |
Show srcAnnot => Show (Program srcAnnot) Source | |
Generic (Program srcAnnot) Source | |
HasHeaders (Program srcAnnot) [Header srcAnnot] Source | |
HasDefinitions (Program srcAnnot) [Definition srcAnnot] Source | |
type Rep (Program srcAnnot) Source |
Headers for a program.
HeaderInclude (Include srcAnnot) | Request to include another Thrift file. |
HeaderNamespace (Namespace srcAnnot) | A |
Eq srcAnnot => Eq (Header srcAnnot) Source | |
Data srcAnnot => Data (Header srcAnnot) Source | |
Ord srcAnnot => Ord (Header srcAnnot) Source | |
Show srcAnnot => Show (Header srcAnnot) Source | |
Generic (Header srcAnnot) Source | |
HasHeaders (Program srcAnnot) [Header srcAnnot] Source | |
type Rep (Header srcAnnot) Source |
_Namespace :: Prism' (Header ann) (Namespace ann) Source
The IDL includes another Thrift file.
include "common.thrift" typedef common.Foo Bar
Include | |
|
Eq srcAnnot => Eq (Include srcAnnot) Source | |
Data srcAnnot => Data (Include srcAnnot) Source | |
Ord srcAnnot => Ord (Include srcAnnot) Source | |
Show srcAnnot => Show (Include srcAnnot) Source | |
Generic (Include srcAnnot) Source | |
HasSrcAnnot (Include srcAnnot) srcAnnot Source | |
HasPath (Include srcAnnot) Text Source | |
type Rep (Include srcAnnot) Source |
data Namespace srcAnnot Source
Namespace directives allows control of the namespace or package name used by the generated code for certain languages.
namespace py my_service.generated
Namespace | |
|
Eq srcAnnot => Eq (Namespace srcAnnot) Source | |
Data srcAnnot => Data (Namespace srcAnnot) Source | |
Ord srcAnnot => Ord (Namespace srcAnnot) Source | |
Show srcAnnot => Show (Namespace srcAnnot) Source | |
Generic (Namespace srcAnnot) Source | |
HasName (Namespace srcAnnot) Text Source | |
HasSrcAnnot (Namespace srcAnnot) srcAnnot Source | |
HasLanguage (Namespace srcAnnot) Text Source | |
type Rep (Namespace srcAnnot) Source |
data Definition srcAnnot Source
A definition either consists of new constants, new types, or new services.
ConstDefinition (Const srcAnnot) | A declared constant. |
TypeDefinition (Type srcAnnot) | A custom type. |
ServiceDefinition (Service srcAnnot) | A service definition. |
Eq srcAnnot => Eq (Definition srcAnnot) Source | |
Data srcAnnot => Data (Definition srcAnnot) Source | |
Ord srcAnnot => Ord (Definition srcAnnot) Source | |
Show srcAnnot => Show (Definition srcAnnot) Source | |
Generic (Definition srcAnnot) Source | |
HasDefinitions (Program srcAnnot) [Definition srcAnnot] Source | |
type Rep (Definition srcAnnot) Source |
_Const :: Prism' (Definition ann) (Const ann) Source
_Service :: Prism' (Definition ann) (Service ann) Source
_Type :: Prism' (Definition ann) (Type ann) Source
A declared constant.
const i32 code = 1;
Const | |
|
Eq srcAnnot => Eq (Const srcAnnot) Source | |
Data srcAnnot => Data (Const srcAnnot) Source | |
Ord srcAnnot => Ord (Const srcAnnot) Source | |
Show srcAnnot => Show (Const srcAnnot) Source | |
Generic (Const srcAnnot) Source | |
HasName (Const srcAnnot) Text Source | |
HasSrcAnnot (Const srcAnnot) srcAnnot Source | |
HasDocstring (Const srcAnnot) Docstring Source | |
HasValue (Const srcAnnot) (ConstValue srcAnnot) Source | |
HasValueType (Const srcAnnot) (TypeReference srcAnnot) Source | |
type Rep (Const srcAnnot) Source |
A service definition.
service MyService { // ... }
Service | |
|
Eq srcAnnot => Eq (Service srcAnnot) Source | |
Data srcAnnot => Data (Service srcAnnot) Source | |
Ord srcAnnot => Ord (Service srcAnnot) Source | |
Show srcAnnot => Show (Service srcAnnot) Source | |
Generic (Service srcAnnot) Source | |
HasName (Service srcAnnot) Text Source | |
HasSrcAnnot (Service srcAnnot) srcAnnot Source | |
HasDocstring (Service srcAnnot) Docstring Source | |
HasAnnotations (Service srcAnnot) [TypeAnnotation] Source | |
HasFunctions (Service srcAnnot) [Function srcAnnot] Source | |
HasExtends (Service srcAnnot) (Maybe Text) Source | |
type Rep (Service srcAnnot) Source |
Defines the various types that can be declared in Thrift.
TypedefType (Typedef srcAnnot) | typedef |
EnumType (Enum srcAnnot) | enum |
StructType (Struct srcAnnot) | struct |
UnionType (Union srcAnnot) | union |
ExceptionType (Exception srcAnnot) | exception |
SenumType (Senum srcAnnot) | senum |
_Exception :: Prism' (Type ann) (Exception ann) Source
A typedef is just an alias for another type.
typedef common.Foo Bar
Typedef | |
|
Eq srcAnnot => Eq (Typedef srcAnnot) Source | |
Data srcAnnot => Data (Typedef srcAnnot) Source | |
Ord srcAnnot => Ord (Typedef srcAnnot) Source | |
Show srcAnnot => Show (Typedef srcAnnot) Source | |
Generic (Typedef srcAnnot) Source | |
HasName (Typedef srcAnnot) Text Source | |
HasSrcAnnot (Typedef srcAnnot) srcAnnot Source | |
HasDocstring (Typedef srcAnnot) Docstring Source | |
HasAnnotations (Typedef srcAnnot) [TypeAnnotation] Source | |
HasTargetType (Typedef srcAnnot) (TypeReference srcAnnot) Source | |
type Rep (Typedef srcAnnot) Source |
Enums are sets of named integer values.
enum Role { User = 1, Admin = 2 }
Enum | |
|
Eq srcAnnot => Eq (Enum srcAnnot) Source | |
Data srcAnnot => Data (Enum srcAnnot) Source | |
Ord srcAnnot => Ord (Enum srcAnnot) Source | |
Show srcAnnot => Show (Enum srcAnnot) Source | |
Generic (Enum srcAnnot) Source | |
HasName (Enum srcAnnot) Text Source | |
HasSrcAnnot (Enum srcAnnot) srcAnnot Source | |
HasDocstring (Enum srcAnnot) Docstring Source | |
HasAnnotations (Enum srcAnnot) [TypeAnnotation] Source | |
HasValues (Enum srcAnnot) [EnumDef srcAnnot] Source | |
type Rep (Enum srcAnnot) Source |
A struct definition
struct User { 1: Role role = Role.User; }
Struct | |
|
Eq srcAnnot => Eq (Struct srcAnnot) Source | |
Data srcAnnot => Data (Struct srcAnnot) Source | |
Ord srcAnnot => Ord (Struct srcAnnot) Source | |
Show srcAnnot => Show (Struct srcAnnot) Source | |
Generic (Struct srcAnnot) Source | |
HasName (Struct srcAnnot) Text Source | |
HasSrcAnnot (Struct srcAnnot) srcAnnot Source | |
HasDocstring (Struct srcAnnot) Docstring Source | |
HasAnnotations (Struct srcAnnot) [TypeAnnotation] Source | |
HasFields (Struct srcAnnot) [Field srcAnnot] Source | |
type Rep (Struct srcAnnot) Source |
A union of other types.
union Value { 1: string stringValue; 2: i32 intValue; }
Union | |
|
Eq srcAnnot => Eq (Union srcAnnot) Source | |
Data srcAnnot => Data (Union srcAnnot) Source | |
Ord srcAnnot => Ord (Union srcAnnot) Source | |
Show srcAnnot => Show (Union srcAnnot) Source | |
Generic (Union srcAnnot) Source | |
HasName (Union srcAnnot) Text Source | |
HasSrcAnnot (Union srcAnnot) srcAnnot Source | |
HasDocstring (Union srcAnnot) Docstring Source | |
HasAnnotations (Union srcAnnot) [TypeAnnotation] Source | |
HasFields (Union srcAnnot) [Field srcAnnot] Source | |
type Rep (Union srcAnnot) Source |
data Exception srcAnnot Source
Exception types.
exception UserDoesNotExist { 1: optional string message 2: required string username }
Exception | |
|
Eq srcAnnot => Eq (Exception srcAnnot) Source | |
Data srcAnnot => Data (Exception srcAnnot) Source | |
Ord srcAnnot => Ord (Exception srcAnnot) Source | |
Show srcAnnot => Show (Exception srcAnnot) Source | |
Generic (Exception srcAnnot) Source | |
HasName (Exception srcAnnot) Text Source | |
HasSrcAnnot (Exception srcAnnot) srcAnnot Source | |
HasDocstring (Exception srcAnnot) Docstring Source | |
HasAnnotations (Exception srcAnnot) [TypeAnnotation] Source | |
HasFields (Exception srcAnnot) [Field srcAnnot] Source | |
type Rep (Exception srcAnnot) Source |
An string-only enum. These are a deprecated feature of Thrift and shouldn't be used.
Senum | |
|
Eq srcAnnot => Eq (Senum srcAnnot) Source | |
Data srcAnnot => Data (Senum srcAnnot) Source | |
Ord srcAnnot => Ord (Senum srcAnnot) Source | |
Show srcAnnot => Show (Senum srcAnnot) Source | |
Generic (Senum srcAnnot) Source | |
HasName (Senum srcAnnot) Text Source | |
HasSrcAnnot (Senum srcAnnot) srcAnnot Source | |
HasDocstring (Senum srcAnnot) Docstring Source | |
HasAnnotations (Senum srcAnnot) [TypeAnnotation] Source | |
HasValues (Senum srcAnnot) [Text] Source | |
type Rep (Senum srcAnnot) Source |
data FieldRequiredness Source
Whether a field is required or optional.
A field inside a struct, exception, or function parameters list.
Field | |
|
Eq srcAnnot => Eq (Field srcAnnot) Source | |
Data srcAnnot => Data (Field srcAnnot) Source | |
Ord srcAnnot => Ord (Field srcAnnot) Source | |
Show srcAnnot => Show (Field srcAnnot) Source | |
Generic (Field srcAnnot) Source | |
HasName (Field srcAnnot) Text Source | |
HasSrcAnnot (Field srcAnnot) srcAnnot Source | |
HasDocstring (Field srcAnnot) Docstring Source | |
HasValueType (Field srcAnnot) (TypeReference srcAnnot) Source | |
HasRequiredness (Field srcAnnot) (Maybe FieldRequiredness) Source | |
HasIdentifier (Field srcAnnot) (Maybe Integer) Source | |
HasDefaultValue (Field srcAnnot) (Maybe (ConstValue srcAnnot)) Source | |
HasAnnotations (Field srcAnnot) [TypeAnnotation] Source | |
HasParameters (Function srcAnnot) [Field srcAnnot] Source | |
HasExceptions (Function srcAnnot) (Maybe [Field srcAnnot]) Source | |
HasFields (Struct srcAnnot) [Field srcAnnot] Source | |
HasFields (Union srcAnnot) [Field srcAnnot] Source | |
HasFields (Exception srcAnnot) [Field srcAnnot] Source | |
type Rep (Field srcAnnot) Source |
A named value inside an enum.
EnumDef | |
|
Eq srcAnnot => Eq (EnumDef srcAnnot) Source | |
Data srcAnnot => Data (EnumDef srcAnnot) Source | |
Ord srcAnnot => Ord (EnumDef srcAnnot) Source | |
Show srcAnnot => Show (EnumDef srcAnnot) Source | |
Generic (EnumDef srcAnnot) Source | |
HasName (EnumDef srcAnnot) Text Source | |
HasSrcAnnot (EnumDef srcAnnot) srcAnnot Source | |
HasDocstring (EnumDef srcAnnot) Docstring Source | |
HasValue (EnumDef srcAnnot) (Maybe Integer) Source | |
HasAnnotations (EnumDef srcAnnot) [TypeAnnotation] Source | |
HasValues (Enum srcAnnot) [EnumDef srcAnnot] Source | |
type Rep (EnumDef srcAnnot) Source |
data ConstValue srcAnnot Source
A constant literal value in the IDL. Only a few basic types, lists, and maps can be presented in Thrift files as literals.
Constants are used for IDL-level constants and default values for fields.
ConstInt Integer | An integer. |
ConstFloat Double | A float. |
ConstLiteral Text | A literal string. |
ConstIdentifier Text srcAnnot | A reference to another constant. |
ConstList [ConstValue srcAnnot] | A literal list containing other constant values. |
ConstMap [(ConstValue srcAnnot, ConstValue srcAnnot)] | A literal list containing other constant values.
|
Eq srcAnnot => Eq (ConstValue srcAnnot) Source | |
Data srcAnnot => Data (ConstValue srcAnnot) Source | |
Ord srcAnnot => Ord (ConstValue srcAnnot) Source | |
Show srcAnnot => Show (ConstValue srcAnnot) Source | |
Generic (ConstValue srcAnnot) Source | |
HasValue (Const srcAnnot) (ConstValue srcAnnot) Source | |
HasDefaultValue (Field srcAnnot) (Maybe (ConstValue srcAnnot)) Source | |
type Rep (ConstValue srcAnnot) Source |
_ConstInt :: forall srcAnnot. Prism' (ConstValue srcAnnot) Integer Source
_ConstFloat :: forall srcAnnot. Prism' (ConstValue srcAnnot) Double Source
_ConstLiteral :: forall srcAnnot. Prism' (ConstValue srcAnnot) Text Source
_ConstIdentifier :: forall srcAnnot. Prism' (ConstValue srcAnnot) (Text, srcAnnot) Source
_ConstList :: forall srcAnnot. Prism' (ConstValue srcAnnot) [ConstValue srcAnnot] Source
_ConstMap :: forall srcAnnot. Prism' (ConstValue srcAnnot) [(ConstValue srcAnnot, ConstValue srcAnnot)] Source
data TypeReference srcAnnot Source
A reference to a type.
DefinedType Text srcAnnot | A custom defined type referred to by name. |
StringType [TypeAnnotation] |
|
BinaryType [TypeAnnotation] |
|
SListType [TypeAnnotation] |
|
BoolType [TypeAnnotation] |
|
ByteType [TypeAnnotation] |
|
I16Type [TypeAnnotation] |
|
I32Type [TypeAnnotation] |
|
I64Type [TypeAnnotation] |
|
DoubleType [TypeAnnotation] |
|
MapType (TypeReference srcAnnot) (TypeReference srcAnnot) [TypeAnnotation] |
|
SetType (TypeReference srcAnnot) [TypeAnnotation] |
|
ListType (TypeReference srcAnnot) [TypeAnnotation] |
|
Eq srcAnnot => Eq (TypeReference srcAnnot) Source | |
Data srcAnnot => Data (TypeReference srcAnnot) Source | |
Ord srcAnnot => Ord (TypeReference srcAnnot) Source | |
Show srcAnnot => Show (TypeReference srcAnnot) Source | |
Generic (TypeReference srcAnnot) Source | |
HasValueType (Field srcAnnot) (TypeReference srcAnnot) Source | |
HasValueType (Const srcAnnot) (TypeReference srcAnnot) Source | |
HasReturnType (Function srcAnnot) (Maybe (TypeReference srcAnnot)) Source | |
HasTargetType (Typedef srcAnnot) (TypeReference srcAnnot) Source | |
type Rep (TypeReference srcAnnot) Source |
_DefinedType :: forall srcAnnot. Prism' (TypeReference srcAnnot) (Text, srcAnnot) Source
_StringType :: forall srcAnnot. Prism' (TypeReference srcAnnot) [TypeAnnotation] Source
_BinaryType :: forall srcAnnot. Prism' (TypeReference srcAnnot) [TypeAnnotation] Source
_SListType :: forall srcAnnot. Prism' (TypeReference srcAnnot) [TypeAnnotation] Source
_BoolType :: forall srcAnnot. Prism' (TypeReference srcAnnot) [TypeAnnotation] Source
_ByteType :: forall srcAnnot. Prism' (TypeReference srcAnnot) [TypeAnnotation] Source
_I16Type :: forall srcAnnot. Prism' (TypeReference srcAnnot) [TypeAnnotation] Source
_I32Type :: forall srcAnnot. Prism' (TypeReference srcAnnot) [TypeAnnotation] Source
_I64Type :: forall srcAnnot. Prism' (TypeReference srcAnnot) [TypeAnnotation] Source
_DoubleType :: forall srcAnnot. Prism' (TypeReference srcAnnot) [TypeAnnotation] Source
_MapType :: forall srcAnnot. Prism' (TypeReference srcAnnot) (TypeReference srcAnnot, TypeReference srcAnnot, [TypeAnnotation]) Source
_SetType :: forall srcAnnot. Prism' (TypeReference srcAnnot) (TypeReference srcAnnot, [TypeAnnotation]) Source
_ListType :: forall srcAnnot. Prism' (TypeReference srcAnnot) (TypeReference srcAnnot, [TypeAnnotation]) Source
A function defined inside a service.
Function | |
|
Eq srcAnnot => Eq (Function srcAnnot) Source | |
Data srcAnnot => Data (Function srcAnnot) Source | |
Ord srcAnnot => Ord (Function srcAnnot) Source | |
Show srcAnnot => Show (Function srcAnnot) Source | |
Generic (Function srcAnnot) Source | |
HasName (Function srcAnnot) Text Source | |
HasSrcAnnot (Function srcAnnot) srcAnnot Source | |
HasDocstring (Function srcAnnot) Docstring Source | |
HasOneWay (Function srcAnnot) Bool Source | |
HasAnnotations (Function srcAnnot) [TypeAnnotation] Source | |
HasReturnType (Function srcAnnot) (Maybe (TypeReference srcAnnot)) Source | |
HasParameters (Function srcAnnot) [Field srcAnnot] Source | |
HasExceptions (Function srcAnnot) (Maybe [Field srcAnnot]) Source | |
HasFunctions (Service srcAnnot) [Function srcAnnot] Source | |
type Rep (Function srcAnnot) Source |
data TypeAnnotation Source
Type annoations may be added in various places in the form,
(foo = "bar", baz, qux = "quux")
These do not usually affect code generation but allow for custom logic if writing your own code generator.
TypeAnnotation | |
|
Eq TypeAnnotation Source | |
Data TypeAnnotation Source | |
Ord TypeAnnotation Source | |
Show TypeAnnotation Source | |
Generic TypeAnnotation Source | |
HasName TypeAnnotation Text Source | |
HasValue TypeAnnotation (Maybe Text) Source | |
HasAnnotations (Field srcAnnot) [TypeAnnotation] Source | |
HasAnnotations (Function srcAnnot) [TypeAnnotation] Source | |
HasAnnotations (Service srcAnnot) [TypeAnnotation] Source | |
HasAnnotations (Typedef srcAnnot) [TypeAnnotation] Source | |
HasAnnotations (EnumDef srcAnnot) [TypeAnnotation] Source | |
HasAnnotations (Enum srcAnnot) [TypeAnnotation] Source | |
HasAnnotations (Struct srcAnnot) [TypeAnnotation] Source | |
HasAnnotations (Union srcAnnot) [TypeAnnotation] Source | |
HasAnnotations (Exception srcAnnot) [TypeAnnotation] Source | |
HasAnnotations (Senum srcAnnot) [TypeAnnotation] Source | |
type Rep TypeAnnotation Source |
type Docstring = Maybe Text Source
Docstrings are Javadoc-style comments attached various defined objects.
/** * Fetches an item. */ Item getItem()
class HasAnnotations s a | s -> a where Source
annotations :: Lens' s a Source
HasAnnotations (Field srcAnnot) [TypeAnnotation] Source | |
HasAnnotations (Function srcAnnot) [TypeAnnotation] Source | |
HasAnnotations (Service srcAnnot) [TypeAnnotation] Source | |
HasAnnotations (Typedef srcAnnot) [TypeAnnotation] Source | |
HasAnnotations (EnumDef srcAnnot) [TypeAnnotation] Source | |
HasAnnotations (Enum srcAnnot) [TypeAnnotation] Source | |
HasAnnotations (Struct srcAnnot) [TypeAnnotation] Source | |
HasAnnotations (Union srcAnnot) [TypeAnnotation] Source | |
HasAnnotations (Exception srcAnnot) [TypeAnnotation] Source | |
HasAnnotations (Senum srcAnnot) [TypeAnnotation] Source |
class HasDefaultValue s a | s -> a where Source
defaultValue :: Lens' s a Source
HasDefaultValue (Field srcAnnot) (Maybe (ConstValue srcAnnot)) Source |
class HasDefinitions s a | s -> a where Source
definitions :: Lens' s a Source
HasDefinitions (Program srcAnnot) [Definition srcAnnot] Source |
class HasDocstring s a | s -> a where Source
HasDocstring (Field srcAnnot) Docstring Source | |
HasDocstring (Function srcAnnot) Docstring Source | |
HasDocstring (Service srcAnnot) Docstring Source | |
HasDocstring (Const srcAnnot) Docstring Source | |
HasDocstring (Typedef srcAnnot) Docstring Source | |
HasDocstring (EnumDef srcAnnot) Docstring Source | |
HasDocstring (Enum srcAnnot) Docstring Source | |
HasDocstring (Struct srcAnnot) Docstring Source | |
HasDocstring (Union srcAnnot) Docstring Source | |
HasDocstring (Exception srcAnnot) Docstring Source | |
HasDocstring (Senum srcAnnot) Docstring Source |
class HasExceptions s a | s -> a where Source
exceptions :: Lens' s a Source
HasExceptions (Function srcAnnot) (Maybe [Field srcAnnot]) Source |
class HasExtends s a | s -> a where Source
HasExtends (Service srcAnnot) (Maybe Text) Source |
class HasFunctions s a | s -> a where Source
HasFunctions (Service srcAnnot) [Function srcAnnot] Source |
class HasHeaders s a | s -> a where Source
HasHeaders (Program srcAnnot) [Header srcAnnot] Source |
class HasIdentifier s a | s -> a where Source
identifier :: Lens' s a Source
HasIdentifier (Field srcAnnot) (Maybe Integer) Source |
class HasLanguage s a | s -> a where Source
HasLanguage (Namespace srcAnnot) Text Source |
class HasName s a | s -> a where Source
HasName TypeAnnotation Text Source | |
HasName (Field srcAnnot) Text Source | |
HasName (Function srcAnnot) Text Source | |
HasName (Service srcAnnot) Text Source | |
HasName (Const srcAnnot) Text Source | |
HasName (Typedef srcAnnot) Text Source | |
HasName (EnumDef srcAnnot) Text Source | |
HasName (Enum srcAnnot) Text Source | |
HasName (Struct srcAnnot) Text Source | |
HasName (Union srcAnnot) Text Source | |
HasName (Exception srcAnnot) Text Source | |
HasName (Senum srcAnnot) Text Source | |
HasName (Namespace srcAnnot) Text Source |
class HasParameters s a | s -> a where Source
parameters :: Lens' s a Source
HasParameters (Function srcAnnot) [Field srcAnnot] Source |
class HasRequiredness s a | s -> a where Source
requiredness :: Lens' s a Source
HasRequiredness (Field srcAnnot) (Maybe FieldRequiredness) Source |
class HasReturnType s a | s -> a where Source
returnType :: Lens' s a Source
HasReturnType (Function srcAnnot) (Maybe (TypeReference srcAnnot)) Source |
class HasSrcAnnot s a | s -> a where Source
HasSrcAnnot (Field srcAnnot) srcAnnot Source | |
HasSrcAnnot (Function srcAnnot) srcAnnot Source | |
HasSrcAnnot (Service srcAnnot) srcAnnot Source | |
HasSrcAnnot (Const srcAnnot) srcAnnot Source | |
HasSrcAnnot (Typedef srcAnnot) srcAnnot Source | |
HasSrcAnnot (EnumDef srcAnnot) srcAnnot Source | |
HasSrcAnnot (Enum srcAnnot) srcAnnot Source | |
HasSrcAnnot (Struct srcAnnot) srcAnnot Source | |
HasSrcAnnot (Union srcAnnot) srcAnnot Source | |
HasSrcAnnot (Exception srcAnnot) srcAnnot Source | |
HasSrcAnnot (Senum srcAnnot) srcAnnot Source | |
HasSrcAnnot (Namespace srcAnnot) srcAnnot Source | |
HasSrcAnnot (Include srcAnnot) srcAnnot Source |
class HasTargetType s a | s -> a where Source
targetType :: Lens' s a Source
HasTargetType (Typedef srcAnnot) (TypeReference srcAnnot) Source |
class HasValueType s a | s -> a where Source
HasValueType (Field srcAnnot) (TypeReference srcAnnot) Source | |
HasValueType (Const srcAnnot) (TypeReference srcAnnot) Source |