Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Types

PQL is dynamically typed at the surface, but every expression has a known PQL type that determines what other expressions it can combine with. You usually don’t need to think about types explicitly — function signatures will guide you — but the table below is useful when chasing a type-mismatch error.

Scalar Types

TypeMeaning
TBooleantrue or false
TInteger / TLongA whole number
TDoubleA double-precision floating point number
TFractionAn exact fraction such as 1/2, 2/5, 13/914
TEquityA TDouble between 0.0 and 1.0
TNumericAny of the numeric types above
TStringA single-quoted string literal

Card / Hand Types

TypeMeaning
TCardA single card (e.g. the Jack of Diamonds)
TCardCountAn integer between 0 and 52
TRankA rank (an Ace, a Ten, a Deuce, …)
TRankSetA set of unique ranks
TStreetOne of preflop, flop, turn, river
THandTypeA 5-card hand category (see below)
TFlopHandCategoryA flop-specific hand category (see below)
THiRatingA hi-hand rating, used for comparing hand strength

Players and Ranges

TypeMeaning
TPlayerA player declared in the from clause (e.g. hero, villain)
TPlayerCountAn integer between 0 and the number of players
TRangeA range expression such as 'AwKw, 77-55'
TBoardRangeA range expression for the board, e.g. 'AwKx2y'

THandType

The 5-card hand category for a player on a given street.

  • highcard
  • pair
  • twopair
  • trips
  • straight
  • flush
  • fullhouse
  • quads
  • straightflush

Hand-type values are bare keywords inside expressions: handType(hero, river) = flush.

TFlopHandCategory

A finer-grained classification of what a flop hand looks like. Useful for “did I flop bottom two?” style filters.

ValueMeaning
flopnothingNo pair, no draws of consequence (made nothing)
flopunderpairPocket pair lower than every flop card
flopthirdpairHits the third (lowest) flop rank
floppocket23Pocket pair between the second and third flop ranks
flopsecondpairHits the second flop rank
floppocket12Pocket pair between the first and second flop ranks
floptoppairHits the top flop rank
flopoverpairPocket pair larger than every flop card
flopbottomtwoHits the two lowest of three distinct flop ranks
floptopandbottomHits the top and bottom of three distinct flop ranks
floptoptwoHits the top two of three distinct flop ranks
floptripsThree of a kind on a paired flop
flopsetThree of a kind on an unpaired flop
flopstraightMade a straight
flopflushMade a flush
flopfullhouseMade a full house (takes precedence over pocket-pair categories)
flopquadsFour of a kind
flopstraightflushStraight flush

Notes on Lo Types

The original PQL spec defines TLoRating and a number of Lo-hand functions. Open PQL has the type symbol reserved but no Lo functions are implemented yet, so TLoRating should be treated as a placeholder.