Copyright | (c) Abhinav Gupta 2015 |
---|---|
License | BSD3 |
Maintainer | Abhinav Gupta <mail@abhinavg.net> |
Stability | experimental |
Safe Haskell | Safe |
Language | Haskell2010 |
Defines the different types Thrift supports at the protocol level.
Synopsis
- data TType a where
- class Typeable a => IsTType a where
- data SomeTType where
- ttypeEquality :: TType a -> TType b -> Maybe (a :~: b)
- ttypeEqT :: forall a b. (IsTType a, IsTType b) => Maybe (a :~: b)
- data TBool
- data TByte
- data TDouble
- data TInt16
- data TInt32
- type TEnum = TInt32
- data TInt64
- data TBinary
- type TText = TBinary
- data TStruct
- type TUnion = TStruct
- type TException = TStruct
- data TMap
- data TSet
- data TList
TType
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.
TBool :: TType TBool | |
TByte :: TType TByte | |
TDouble :: TType TDouble | |
TInt16 :: TType TInt16 | |
TInt32 :: TType TInt32 | |
TInt64 :: TType TInt64 | |
TBinary :: TType TBinary | |
TStruct :: TType TStruct | |
TMap :: TType TMap | |
TSet :: TType TSet | |
TList :: TType TList |
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.
Based on the context in which this is used, it will automatically
return the corresponding TType
object.
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.
ttypeEqT :: forall a b. (IsTType a, IsTType b) => Maybe (a :~: b) Source #
Witness the equality of two TTypes.
Implicit version of ttypeEquality
.
Tags
bool
byte
double
i16
i32
i64
binary
struct
type TException = TStruct Source #
exception
map<k, v>
set<x>