Portability | Non-portable (GHC extensions) |
---|---|

Stability | experimental |

Maintainer | Anders Kaseorg <andersk@mit.edu> |

Safe Haskell | None |

The finite nimbers, `Nimber`

, are a quadratically closed field of
characteristic 2 introduced in combinatorial game theory.

`>>>`

*3`257 + 258 :: Nimber`

`>>>`

*98433322`sqrt 123456789 :: Nimber`

`>>>`

*98433322`123456789/sqrt 123456789 :: Nimber`

This implementation was inspired by Patrick Hurst’s slow Haskell implementation that this replaced (with his permission), and by Michel Van den Bergh’s Python implementation at https://web.archive.org/web/20101124110959/http://alpha.uhasselt.be/Research/Algebra/Members/nimbers/nimbers.py.

- data Nimber
- fromNimber :: Nimber -> Integer
- data NimberException

# Documentation

The type of finite nimbers.

Enum Nimber | |

Eq Nimber | |

Floating Nimber | This partial |

Fractional Nimber | Note: Although nimbers support division, the |

Num Nimber | |

Ord Nimber | |

Read Nimber | |

Show Nimber |

fromNimber :: Nimber -> IntegerSource

data NimberException Source

The type of exceptions thrown by impossible `Nimber`

operations.

NegativeNimber | A negative integer was converted to a nimber. |

Innimerable String | A transcendental function was called on nimbers. |