Safe Haskell | Safe-Inferred |
---|

- data OddWord a n
- class TypeNum a
- data One a
- data Zero a
- type Word1 = OddWord Word8 (One ())
- type Word2 = OddWord Word8 (One (Zero ()))
- type Word3 = OddWord Word8 (One (One ()))
- type Word4 = OddWord Word8 (One (Zero (Zero ())))
- type Word5 = OddWord Word8 (One (Zero (One ())))
- type Word6 = OddWord Word8 (One (One (Zero ())))
- type Word7 = OddWord Word8 (One (One (One ())))
- type Word9 = OddWord Word16 (One (Zero (Zero (One ()))))
- type Word10 = OddWord Word16 (One (Zero (One (Zero ()))))
- type Word11 = OddWord Word16 (One (Zero (One (One ()))))
- type Word12 = OddWord Word16 (One (One (Zero (Zero ()))))
- type Word13 = OddWord Word16 (One (One (Zero (One ()))))
- type Word14 = OddWord Word16 (One (One (One (Zero ()))))
- type Word15 = OddWord Word16 (One (One (One (One ()))))
- type Word17 = OddWord Word32 (One (Zero (Zero (Zero (One ())))))
- type Word18 = OddWord Word32 (One (Zero (Zero (One (Zero ())))))
- type Word19 = OddWord Word32 (One (Zero (Zero (One (One ())))))
- type Word20 = OddWord Word32 (One (Zero (One (Zero (Zero ())))))
- type Word21 = OddWord Word32 (One (Zero (One (Zero (One ())))))
- type Word22 = OddWord Word32 (One (Zero (One (One (Zero ())))))
- type Word23 = OddWord Word32 (One (Zero (One (One (One ())))))
- type Word24 = OddWord Word32 (One (One (Zero (Zero (Zero ())))))
- type Word25 = OddWord Word32 (One (One (Zero (Zero (One ())))))
- type Word26 = OddWord Word32 (One (One (Zero (One (Zero ())))))
- type Word27 = OddWord Word32 (One (One (Zero (One (One ())))))
- type Word28 = OddWord Word32 (One (One (One (Zero (Zero ())))))
- type Word29 = OddWord Word32 (One (One (One (Zero (One ())))))
- type Word30 = OddWord Word32 (One (One (One (One (Zero ())))))
- type Word31 = OddWord Word32 (One (One (One (One (One ())))))
- type Word33 = OddWord Word64 (One (Zero (Zero (Zero (Zero (One ()))))))
- type Word34 = OddWord Word64 (One (Zero (Zero (Zero (One (Zero ()))))))
- type Word35 = OddWord Word64 (One (Zero (Zero (Zero (One (One ()))))))
- type Word36 = OddWord Word64 (One (Zero (Zero (One (Zero (Zero ()))))))
- type Word37 = OddWord Word64 (One (Zero (Zero (One (Zero (One ()))))))
- type Word38 = OddWord Word64 (One (Zero (Zero (One (One (Zero ()))))))
- type Word39 = OddWord Word64 (One (Zero (Zero (One (One (One ()))))))
- type Word40 = OddWord Word64 (One (Zero (One (Zero (Zero (Zero ()))))))
- type Word41 = OddWord Word64 (One (Zero (One (Zero (Zero (One ()))))))
- type Word42 = OddWord Word64 (One (Zero (One (Zero (One (Zero ()))))))
- type Word43 = OddWord Word64 (One (Zero (One (Zero (One (One ()))))))
- type Word44 = OddWord Word64 (One (Zero (One (One (Zero (Zero ()))))))
- type Word45 = OddWord Word64 (One (Zero (One (One (Zero (One ()))))))
- type Word46 = OddWord Word64 (One (Zero (One (One (One (Zero ()))))))
- type Word47 = OddWord Word64 (One (Zero (One (One (One (One ()))))))
- type Word48 = OddWord Word64 (One (One (Zero (Zero (Zero (Zero ()))))))
- type Word49 = OddWord Word64 (One (One (Zero (Zero (Zero (One ()))))))
- type Word50 = OddWord Word64 (One (One (Zero (Zero (One (Zero ()))))))
- type Word51 = OddWord Word64 (One (One (Zero (Zero (One (One ()))))))
- type Word52 = OddWord Word64 (One (One (Zero (One (Zero (Zero ()))))))
- type Word53 = OddWord Word64 (One (One (Zero (One (Zero (One ()))))))
- type Word54 = OddWord Word64 (One (One (Zero (One (One (Zero ()))))))
- type Word55 = OddWord Word64 (One (One (Zero (One (One (One ()))))))
- type Word56 = OddWord Word64 (One (One (One (Zero (Zero (Zero ()))))))
- type Word57 = OddWord Word64 (One (One (One (Zero (Zero (One ()))))))
- type Word58 = OddWord Word64 (One (One (One (Zero (One (Zero ()))))))
- type Word59 = OddWord Word64 (One (One (One (Zero (One (One ()))))))
- type Word60 = OddWord Word64 (One (One (One (One (Zero (Zero ()))))))
- type Word61 = OddWord Word64 (One (One (One (One (Zero (One ()))))))
- type Word62 = OddWord Word64 (One (One (One (One (One (Zero ()))))))
- type Word63 = OddWord Word64 (One (One (One (One (One (One ()))))))

# Odd Word Wrapper

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.

(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, Num a, Bits a, TypeNum n) => Read (OddWord a n) | |

(Real a, Bits a, TypeNum n) => Real (OddWord a n) | |

Show a => Show (OddWord a n) | |

(Num a, Bits a, TypeNum n) => Bits (OddWord a n) |

# Type Numbers

Intances of `TypeNum`

represent type-level numbers.

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

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