OddWord-1.0.0: Provides a wrapper for deriving word types with fewer bits.

Data.Word.Odd

Contents

Synopsis

Odd Word Wrapper

data OddWord a n Source

OddWord wraps the integer type specified in the first type parameter and exposes a subset of the available bits as an unsigned word. The number of bits to expose is encoded into the second type parameter.

The predefined word types provided by this module give some examples.

Instances

(Num a, Bits a, TypeNum n) => Bounded (OddWord a n) 
(Enum a, Ord a, Num a, Bits a, TypeNum n) => Enum (OddWord a n) 
Eq a => Eq (OddWord a n) 
(Integral a, Bits a, TypeNum n) => Integral (OddWord a n) 
(Num a, Bits a, TypeNum n) => Num (OddWord a n) 
Ord a => Ord (OddWord a n) 
Read a => Read (OddWord a n) 
(Real a, Bits a, TypeNum n) => Real (OddWord a n) 
Show a => Show (OddWord a n) 
(Bits a, TypeNum n) => Bits (OddWord a n) 

Type Numbers

class TypeNum a Source

Intances of TypeNum represent type-level numbers.

Instances

TypeNum () 
TypeNum a => TypeNum (Zero a) 
TypeNum a => TypeNum (One a) 

data One a Source

Represents a type-level number with a leading one bit followed by the string of digits specified by a.

Instances

TypeNum a => TypeNum (One a) 

data Zero a Source

Represents a type-level number with a placeholder zero bit followed by the string of digits specified by a.

Instances

TypeNum a => TypeNum (Zero a) 

Predefined Odd Words