pinch-0.4.3.0: An alternative implementation of Thrift for Haskell.
Copyright(c) Abhinav Gupta 2015
LicenseBSD3
MaintainerAbhinav Gupta <mail@abhinavg.net>
Stabilityexperimental
Safe HaskellSafe-Inferred
LanguageHaskell2010

Pinch.Internal.TType

Contents

Description

Defines the different types Thrift supports at the protocol level.

Synopsis

TType

data TType a where Source #

Represents the type of a Thrift value.

Objects of this type are tagged with one of the TType tags, so this type also acts as a singleton on the TTypes. It allows writing code that can enforce properties about the TType of values at compile time.

Instances

Instances details
Show (TType a) Source # 
Instance details

Defined in Pinch.Internal.TType

Methods

showsPrec :: Int -> TType a -> ShowS #

show :: TType a -> String #

showList :: [TType a] -> ShowS #

Eq (TType a) Source # 
Instance details

Defined in Pinch.Internal.TType

Methods

(==) :: TType a -> TType a -> Bool #

(/=) :: TType a -> TType a -> Bool #

Hashable (TType a) Source # 
Instance details

Defined in Pinch.Internal.TType

Methods

hashWithSalt :: Int -> TType a -> Int #

hash :: TType a -> Int #

class Typeable a => IsTType a where Source #

Typeclass used to map type-leve TTypes into TType objects. All TType tags are instances of this class.

Methods

ttype :: TType a Source #

Based on the context in which this is used, it will automatically return the corresponding TType object.

Instances

Instances details
IsTType TBinary Source # 
Instance details

Defined in Pinch.Internal.TType

IsTType TBool Source # 
Instance details

Defined in Pinch.Internal.TType

IsTType TByte Source # 
Instance details

Defined in Pinch.Internal.TType

IsTType TDouble Source # 
Instance details

Defined in Pinch.Internal.TType

IsTType TInt16 Source # 
Instance details

Defined in Pinch.Internal.TType

IsTType TInt32 Source # 
Instance details

Defined in Pinch.Internal.TType

IsTType TInt64 Source # 
Instance details

Defined in Pinch.Internal.TType

IsTType TList Source # 
Instance details

Defined in Pinch.Internal.TType

IsTType TMap Source # 
Instance details

Defined in Pinch.Internal.TType

Methods

ttype :: TType TMap Source #

IsTType TSet Source # 
Instance details

Defined in Pinch.Internal.TType

Methods

ttype :: TType TSet Source #

IsTType TStruct Source # 
Instance details

Defined in Pinch.Internal.TType

data SomeTType where Source #

Used when the TType for something is not known at compile time. Typically, this will be pattern matched inside a case statement and code that depends on the TType will be go there.

Constructors

SomeTType :: forall a. IsTType a => TType a -> SomeTType 

Instances

Instances details
Show SomeTType Source # 
Instance details

Defined in Pinch.Internal.TType

ttypeEquality :: TType a -> TType b -> Maybe (a :~: b) Source #

Witness the equality of two ttypes.

ttypeEqT :: forall a b. (IsTType a, IsTType b) => Maybe (a :~: b) Source #

Witness the equality of two TTypes.

Implicit version of ttypeEquality.

Tags

data TBool Source #

bool

Instances

Instances details
IsTType TBool Source # 
Instance details

Defined in Pinch.Internal.TType

data TByte Source #

byte

Instances

Instances details
IsTType TByte Source # 
Instance details

Defined in Pinch.Internal.TType

data TDouble Source #

double

Instances

Instances details
IsTType TDouble Source # 
Instance details

Defined in Pinch.Internal.TType

data TInt16 Source #

i16

Instances

Instances details
IsTType TInt16 Source # 
Instance details

Defined in Pinch.Internal.TType

data TInt32 Source #

i32

Instances

Instances details
IsTType TInt32 Source # 
Instance details

Defined in Pinch.Internal.TType

type TEnum = TInt32 Source #

enum

data TInt64 Source #

i64

Instances

Instances details
IsTType TInt64 Source # 
Instance details

Defined in Pinch.Internal.TType

data TBinary Source #

binary

Instances

Instances details
IsTType TBinary Source # 
Instance details

Defined in Pinch.Internal.TType

type TText = TBinary Source #

string

data TStruct Source #

struct

Instances

Instances details
IsTType TStruct Source # 
Instance details

Defined in Pinch.Internal.TType

type TUnion = TStruct Source #

union

type TException = TStruct Source #

exception

data TMap Source #

map<k, v>

Instances

Instances details
IsTType TMap Source # 
Instance details

Defined in Pinch.Internal.TType

Methods

ttype :: TType TMap Source #

data TSet Source #

set<x>

Instances

Instances details
IsTType TSet Source # 
Instance details

Defined in Pinch.Internal.TType

Methods

ttype :: TType TSet Source #

data TList Source #

list<x>

Instances

Instances details
IsTType TList Source # 
Instance details

Defined in Pinch.Internal.TType