pinch-0.3.4.1: An alternative implementation of Thrift for Haskell.

Copyright(c) Abhinav Gupta 2015
LicenseBSD3
MaintainerAbhinav Gupta <mail@abhinavg.net>
Stabilityexperimental
Safe HaskellSafe
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
Eq (TType a) Source # 
Instance details

Defined in Pinch.Internal.TType

Methods

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

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

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 #

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
IsTType TList Source # 
Instance details

Defined in Pinch.Internal.TType

IsTType TSet Source # 
Instance details

Defined in Pinch.Internal.TType

Methods

ttype :: TType TSet Source #

IsTType TMap Source # 
Instance details

Defined in Pinch.Internal.TType

Methods

ttype :: TType TMap Source #

IsTType TStruct Source # 
Instance details

Defined in Pinch.Internal.TType

IsTType TBinary Source # 
Instance details

Defined in Pinch.Internal.TType

IsTType TInt64 Source # 
Instance details

Defined in Pinch.Internal.TType

IsTType TInt32 Source # 
Instance details

Defined in Pinch.Internal.TType

IsTType TInt16 Source # 
Instance details

Defined in Pinch.Internal.TType

IsTType TDouble Source # 
Instance details

Defined in Pinch.Internal.TType

IsTType TByte Source # 
Instance details

Defined in Pinch.Internal.TType

IsTType TBool 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
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
IsTType TBool Source # 
Instance details

Defined in Pinch.Internal.TType

data TByte Source #

byte
Instances
IsTType TByte Source # 
Instance details

Defined in Pinch.Internal.TType

data TDouble Source #

double
Instances
IsTType TDouble Source # 
Instance details

Defined in Pinch.Internal.TType

data TInt16 Source #

i16
Instances
IsTType TInt16 Source # 
Instance details

Defined in Pinch.Internal.TType

data TInt32 Source #

i32
Instances
IsTType TInt32 Source # 
Instance details

Defined in Pinch.Internal.TType

type TEnum = TInt32 Source #

enum

data TInt64 Source #

i64
Instances
IsTType TInt64 Source # 
Instance details

Defined in Pinch.Internal.TType

data TBinary Source #

binary
Instances
IsTType TBinary Source # 
Instance details

Defined in Pinch.Internal.TType

type TText = TBinary Source #

string

data TStruct Source #

struct
Instances
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
IsTType TMap Source # 
Instance details

Defined in Pinch.Internal.TType

Methods

ttype :: TType TMap Source #

data TSet Source #

set<x>
Instances
IsTType TSet Source # 
Instance details

Defined in Pinch.Internal.TType

Methods

ttype :: TType TSet Source #

data TList Source #

list<x>
Instances
IsTType TList Source # 
Instance details

Defined in Pinch.Internal.TType