poker-base-0.1.0.0: A library for core poker types
Safe HaskellNone
LanguageHaskell2010

Poker.Range

Description

A range of Hole cards.

Synopsis

Documentation

data Freq Source #

A frequency is an unevaluated ratio that indicates how often a decision was made. For example, the value Freq (12, 34) indicates that out of the 34 people who faced this decision, 12 chose to make this decision.

Constructors

Freq !Int !Int 

Instances

Instances details
Eq Freq Source # 
Instance details

Defined in Poker.Range

Methods

(==) :: Freq -> Freq -> Bool #

(/=) :: Freq -> Freq -> Bool #

Show Freq Source # 
Instance details

Defined in Poker.Range

Methods

showsPrec :: Int -> Freq -> ShowS #

show :: Freq -> String #

showList :: [Freq] -> ShowS #

Semigroup Freq Source # 
Instance details

Defined in Poker.Range

Methods

(<>) :: Freq -> Freq -> Freq #

sconcat :: NonEmpty Freq -> Freq #

stimes :: Integral b => b -> Freq -> Freq #

Monoid Freq Source # 
Instance details

Defined in Poker.Range

Methods

mempty :: Freq #

mappend :: Freq -> Freq -> Freq #

mconcat :: [Freq] -> Freq #

newtype Range a b Source #

A simple wrapper around a Map that uses different instances for Semigroup. Range's Semigroup instance combines values at the same keys with <> (unlike the Map Semigroup instance from containers).

Note that the Range's internal Map is strict.

Constructors

Range 

Fields

Instances

Instances details
(Eq a, Eq b) => Eq (Range a b) Source # 
Instance details

Defined in Poker.Range

Methods

(==) :: Range a b -> Range a b -> Bool #

(/=) :: Range a b -> Range a b -> Bool #

(Ord a, Read a, Read b) => Read (Range a b) Source # 
Instance details

Defined in Poker.Range

(Show a, Show b) => Show (Range a b) Source # 
Instance details

Defined in Poker.Range

Methods

showsPrec :: Int -> Range a b -> ShowS #

show :: Range a b -> String #

showList :: [Range a b] -> ShowS #

(Ord a, Monoid b) => Semigroup (Range a b) Source #
>>> let left = rangeFromList [("55p" :: ShapedHole, Freq 1 3)]
>>> let right = rangeFromList [("55p", Freq 10 32)]
>>> left <> right
Range {_range = fromList [(Pair Five,Freq 11 35)]}
Instance details

Defined in Poker.Range

Methods

(<>) :: Range a b -> Range a b -> Range a b #

sconcat :: NonEmpty (Range a b) -> Range a b #

stimes :: Integral b0 => b0 -> Range a b -> Range a b #

(Ord a, Monoid b) => Monoid (Range a b) Source #
>>> mempty @(Range Hole Freq)
Range {_range = fromList []}
Instance details

Defined in Poker.Range

Methods

mempty :: Range a b #

mappend :: Range a b -> Range a b -> Range a b #

mconcat :: [Range a b] -> Range a b #

(Pretty a, Pretty b) => Pretty (Range a b) Source # 
Instance details

Defined in Poker.Range

Methods

pretty :: Range a b -> Doc ann #

prettyList :: [Range a b] -> Doc ann #

rangeFromList :: Ord a => [(a, b)] -> Range a b Source #

Make a Range form a list.

getDecisionFreqRange :: Foldable f => (b -> Bool) -> Range a (f b) -> Range a Freq Source #

Converts a Range from key to action, to a Range from key to decision frequency, given a predicate that returns True if the action matched the decision.

holdingRangeToShapedRange :: Monoid v => Range Hole v -> Range ShapedHole v Source #

Convert from a Range of hole cards to a Range of ShapedHole.

addHoleToShapedRange :: Num a => a -> Hole -> Range ShapedHole a -> Range ShapedHole a Source #

Add a singleton Hole hand to a Range of ShapedHole.