every-bit-counts-0.1: A functional pearl on encoding and decoding using question-and-answer strategies

PGames

Documentation

data GamesOver whereSource

Constructors

NilGames :: GamesOver Void 
ConsGames :: Int -> Game t -> GamesOver s -> GamesOver (Either t s) 

data Game whereSource

Constructors

Single :: ISO t () -> Game t 
Split :: ISO t s -> GamesOver s -> Game t 

split3 :: ISO t (Either t1 (Either t2 (Either t3 Void))) -> Int -> Game t1 -> Int -> Game t2 -> Int -> Game t3 -> Game tSource

flat2 :: ISO t (Either t1 t2) -> ISO t (Either t1 (Either t2 Void))Source

flat3 :: ISO t (Either t1 (Either t2 t3)) -> ISO t (Either t1 (Either t2 (Either t3 Void)))Source

split2 :: ISO t (Either t1 t2) -> Int -> Game t1 -> Int -> Game t2 -> Game tSource

split :: ISO t (Either t1 t2) -> Game t1 -> Game t2 -> Game tSource

(+>) :: Game t -> ISO s t -> Game sSource

type Bit = IntSource

bits :: Int -> Bit -> [Bit]Source

enc :: Game t -> t -> [Bit]Source

decode :: EInterval -> [Bit] -> Game t -> tSource

ominus :: (Int, [Bit]) -> [Bit] -> (Int, [Bit])Source

fscale :: (Int, (Int, [Bit])) -> IntSource

destream :: EInterval -> (Int, [Bit]) -> Game t -> tSource

testGame :: Game t -> t -> tSource