pinch-0.3.0.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) 
Show (TType a) 
Hashable (TType a) 

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.

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

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

data TByte Source

byte

Instances

data TDouble Source

double

Instances

data TInt16 Source

i16

Instances

data TInt32 Source

i32

Instances

type TEnum = TInt32 Source

enum

data TInt64 Source

i64

Instances

data TBinary Source

binary

Instances

type TText = TBinary Source

string

data TStruct Source

struct

Instances

type TUnion = TStruct Source

union

type TException = TStruct Source

exception

data TMap Source

map<k, v>

Instances

data TSet Source

set<x>

Instances

data TList Source

list<x>

Instances