language-thrift-0.6.0.1: Parser and pretty printer for the Thrift IDL format.

Copyright(c) Abhinav Gupta 2015
LicenseBSD3
MaintainerAbhinav Gupta <mail@abhinavg.net>
Stabilityexperimental
Safe HaskellNone
LanguageHaskell2010

Language.Thrift.Types

Description

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.

Synopsis

Documentation

data Program srcAnnot Source

A program represents a single Thrift document.

Constructors

Program 

Fields

programHeaders :: [Header srcAnnot]

Headers in a document define includes and namespaces.

programDefinitions :: [Definition srcAnnot]

Types and services defined in the document.

Instances

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 

data Header srcAnnot Source

Headers for a program.

Constructors

HeaderInclude (Include srcAnnot)

Request to include another Thrift file.

HeaderNamespace (Namespace srcAnnot)

A namespace specifier.

Instances

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 

data Include srcAnnot Source

The IDL includes another Thrift file.

include "common.thrift"

typedef common.Foo Bar

Constructors

Include 

Fields

includePath :: Text

Path to the included file.

includeSrcAnnot :: srcAnnot
 

Instances

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

Constructors

Namespace 

Fields

namespaceLanguage :: Text

The language for which the namespace is being specified. This may be * to refer to all languages.

namespaceName :: Text

Namespace or package path to use in the generated code for that language.

namespaceSrcAnnot :: srcAnnot
 

Instances

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.

Constructors

ConstDefinition (Const srcAnnot)

A declared constant.

TypeDefinition (Type srcAnnot)

A custom type.

ServiceDefinition (Service srcAnnot)

A service definition.

Instances

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 

data Const srcAnnot Source

A declared constant.

const i32 code = 1;

Constructors

Const 

Fields

constValueType :: TypeReference srcAnnot

Type of the constant.

constName :: Text

Name of the constant.

constValue :: ConstValue srcAnnot

Value of the constant.

constDocstring :: Docstring

Documentation.

constSrcAnnot :: srcAnnot
 

Instances

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 

data Service srcAnnot Source

A service definition.

service MyService {
    // ...
}

Constructors

Service 

Fields

serviceName :: Text

Name of the service.

serviceExtends :: Maybe Text

Name of the service this service extends.

serviceFunctions :: [Function srcAnnot]

All the functions defined for the service.

serviceAnnotations :: [TypeAnnotation]

Annotations added to the service.

serviceDocstring :: Docstring

Documentation.

serviceSrcAnnot :: srcAnnot
 

Instances

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 

data Type srcAnnot Source

Defines the various types that can be declared in Thrift.

Constructors

TypedefType (Typedef srcAnnot)
typedef
EnumType (Enum srcAnnot)
enum
StructType (Struct srcAnnot)
struct
UnionType (Union srcAnnot)
union
ExceptionType (Exception srcAnnot)
exception
SenumType (Senum srcAnnot)
senum

Instances

Eq srcAnnot => Eq (Type srcAnnot) Source 
Data srcAnnot => Data (Type srcAnnot) Source 
Ord srcAnnot => Ord (Type srcAnnot) Source 
Show srcAnnot => Show (Type srcAnnot) Source 
Generic (Type srcAnnot) Source 
type Rep (Type srcAnnot) Source 

_Enum :: Prism' (Type ann) (Enum ann) Source

_Union :: Prism' (Type ann) (Union ann) Source

_Senum :: Prism' (Type ann) (Senum ann) Source

data Typedef srcAnnot Source

A typedef is just an alias for another type.

typedef common.Foo Bar

Constructors

Typedef 

Fields

typedefTargetType :: TypeReference srcAnnot

The aliased type.

typedefName :: Text

Name of the new type.

typedefAnnotations :: [TypeAnnotation]

Annotations added to the typedef.

typedefDocstring :: Docstring

Documentation.

typedefSrcAnnot :: srcAnnot
 

Instances

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 

data Enum srcAnnot Source

Enums are sets of named integer values.

enum Role {
    User = 1, Admin = 2
}

Constructors

Enum 

Fields

enumName :: Text

Name of the enum type.

enumValues :: [EnumDef srcAnnot]

Values defined in the enum.

enumAnnotations :: [TypeAnnotation]

Annotations added to the enum.

enumDocstring :: Docstring

Documentation.

enumSrcAnnot :: srcAnnot
 

Instances

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 

data Struct srcAnnot Source

A struct definition

struct User {
    1: Role role = Role.User;
}

Constructors

Struct 

Fields

structName :: Text

Name of the struct.

structFields :: [Field srcAnnot]

Fields defined in the struct.

structAnnotations :: [TypeAnnotation]

Annotations added to the struct.

structDocstring :: Docstring

Documentation.

structSrcAnnot :: srcAnnot
 

Instances

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 

data Union srcAnnot Source

A union of other types.

union Value {
    1: string stringValue;
    2: i32 intValue;
}

Constructors

Union 

Fields

unionName :: Text

Name of the union.

unionFields :: [Field srcAnnot]

Fields defined in the union.

unionAnnotations :: [TypeAnnotation]

Annotations added to the union.

unionDocstring :: Docstring

Documentation.

unionSrcAnnot :: srcAnnot
 

Instances

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
}

Constructors

Exception 

Fields

exceptionName :: Text

Name of the exception.

exceptionFields :: [Field srcAnnot]

Fields defined in the exception.

exceptionAnnotations :: [TypeAnnotation]

Annotations added to the exception.

exceptionDocstring :: Docstring

Documentation.

exceptionSrcAnnot :: srcAnnot
 

Instances

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 

data Senum srcAnnot Source

An string-only enum. These are a deprecated feature of Thrift and shouldn't be used.

Constructors

Senum 

Fields

senumName :: Text
 
senumValues :: [Text]
 
senumAnnotations :: [TypeAnnotation]

Annotations added to the senum.

senumDocstring :: Docstring

Documentation.

senumSrcAnnot :: srcAnnot
 

Instances

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 Field srcAnnot Source

A field inside a struct, exception, or function parameters list.

Constructors

Field 

Fields

fieldIdentifier :: Maybe Integer

Position of the field.

While this is optional, it is recommended that Thrift files always contain specific field IDs.

fieldRequiredness :: Maybe FieldRequiredness

Whether this field is required or not.

Behavior may differ between languages if requiredness is not specified. Therefore it's recommended that requiredness for a field is always specified.

fieldValueType :: TypeReference srcAnnot

Type of value the field holds.

fieldName :: Text

Name of the field.

fieldDefaultValue :: Maybe (ConstValue srcAnnot)

Default value of the field, if any.

fieldAnnotations :: [TypeAnnotation]

Field annotations.

fieldDocstring :: Docstring

Documentation.

fieldSrcAnnot :: srcAnnot
 

Instances

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 

data EnumDef srcAnnot Source

A named value inside an enum.

Constructors

EnumDef 

Fields

enumDefName :: Text

Name of the value.

enumDefValue :: Maybe Integer

Value attached to the enum for that name.

enumDefAnnotations :: [TypeAnnotation]

Annotations added to this enum field.

enumDefDocstring :: Docstring

Documentation

enumDefSrcAnnot :: srcAnnot
 

Instances

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.

Constructors

ConstInt Integer

An integer. 42

ConstFloat Double

A float. 4.2

ConstLiteral Text

A literal string. "hello"

ConstIdentifier Text srcAnnot

A reference to another constant. Foo.bar

ConstList [ConstValue srcAnnot]

A literal list containing other constant values. [42]

ConstMap [(ConstValue srcAnnot, ConstValue srcAnnot)]

A literal list containing other constant values. {"hellO": 1, "world": 2}

Instances

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.

Constructors

DefinedType Text srcAnnot

A custom defined type referred to by name.

StringType [TypeAnnotation]

string and annotations.

BinaryType [TypeAnnotation]

binary and annotations.

SListType [TypeAnnotation]

slist and annotations.

BoolType [TypeAnnotation]

bool and annotations.

ByteType [TypeAnnotation]

byte and annotations.

I16Type [TypeAnnotation]

i16 and annotations.

I32Type [TypeAnnotation]

i32 and annotations.

I64Type [TypeAnnotation]

i64 and annotations.

DoubleType [TypeAnnotation]

double and annotations.

MapType (TypeReference srcAnnot) (TypeReference srcAnnot) [TypeAnnotation]

map<foo, bar> and annotations.

SetType (TypeReference srcAnnot) [TypeAnnotation]

set<baz> and annotations.

ListType (TypeReference srcAnnot) [TypeAnnotation]

list<qux> and annotations.

Instances

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

data Function srcAnnot Source

A function defined inside a service.

Constructors

Function 

Fields

functionOneWay :: Bool

Whether the function is oneway. If it's one way, it cannot receive repsonses.

functionReturnType :: Maybe (TypeReference srcAnnot)

Return type of the function, or Nothing if it's void or oneway.

functionName :: Text

Name of the function.

functionParameters :: [Field srcAnnot]

Parameters accepted by the function.

functionExceptions :: Maybe [Field srcAnnot]

Exceptions raised by the function, if any.

functionAnnotations :: [TypeAnnotation]

Annotations added to the function.

functionDocstring :: Docstring

Documentation.

functionSrcAnnot :: srcAnnot
 

Instances

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.

Constructors

TypeAnnotation 

Fields

typeAnnotationName :: Text

Name of the annotation.

typeAnnotationValue :: Maybe Text

Value for the annotation.

type Docstring = Maybe Text Source

Docstrings are Javadoc-style comments attached various defined objects.

/**
 * Fetches an item.
 */
Item getItem()

class HasDefaultValue s a | s -> a where Source

Methods

defaultValue :: Lens' s a Source

Instances

HasDefaultValue (Field srcAnnot) (Maybe (ConstValue srcAnnot)) Source 

class HasDefinitions s a | s -> a where Source

Methods

definitions :: Lens' s a Source

Instances

HasDefinitions (Program srcAnnot) [Definition srcAnnot] Source 

class HasExceptions s a | s -> a where Source

Methods

exceptions :: Lens' s a Source

Instances

HasExceptions (Function srcAnnot) (Maybe [Field srcAnnot]) Source 

class HasExtends s a | s -> a where Source

Methods

extends :: Lens' s a Source

Instances

class HasFields s a | s -> a where Source

Methods

fields :: Lens' s a Source

Instances

HasFields (Struct srcAnnot) [Field srcAnnot] Source 
HasFields (Union srcAnnot) [Field srcAnnot] Source 
HasFields (Exception srcAnnot) [Field srcAnnot] Source 

class HasFunctions s a | s -> a where Source

Methods

functions :: Lens' s a Source

Instances

HasFunctions (Service srcAnnot) [Function srcAnnot] Source 

class HasHeaders s a | s -> a where Source

Methods

headers :: Lens' s a Source

Instances

HasHeaders (Program srcAnnot) [Header srcAnnot] Source 

class HasIdentifier s a | s -> a where Source

Methods

identifier :: Lens' s a Source

Instances

class HasLanguage s a | s -> a where Source

Methods

language :: Lens' s a Source

Instances

class HasName s a | s -> a where Source

Methods

name :: Lens' s a Source

class HasOneWay s a | s -> a where Source

Methods

oneWay :: Lens' s a Source

Instances

class HasParameters s a | s -> a where Source

Methods

parameters :: Lens' s a Source

Instances

HasParameters (Function srcAnnot) [Field srcAnnot] Source 

class HasPath s a | s -> a where Source

Methods

path :: Lens' s a Source

Instances

HasPath (Include srcAnnot) Text Source 

class HasRequiredness s a | s -> a where Source

Methods

requiredness :: Lens' s a Source

class HasReturnType s a | s -> a where Source

Methods

returnType :: Lens' s a Source

Instances

HasReturnType (Function srcAnnot) (Maybe (TypeReference srcAnnot)) Source 

class HasSrcAnnot s a | s -> a where Source

Methods

srcAnnot :: Lens' s a Source

Instances

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

Methods

targetType :: Lens' s a Source

Instances

HasTargetType (Typedef srcAnnot) (TypeReference srcAnnot) Source 

class HasValue s a | s -> a where Source

Methods

value :: Lens' s a Source

class HasValues s a | s -> a where Source

Methods

values :: Lens' s a Source

Instances

HasValues (Enum srcAnnot) [EnumDef srcAnnot] Source 
HasValues (Senum srcAnnot) [Text] Source 

class HasValueType s a | s -> a where Source

Methods

valueType :: Lens' s a Source

Instances

HasValueType (Field srcAnnot) (TypeReference srcAnnot) Source 
HasValueType (Const srcAnnot) (TypeReference srcAnnot) Source