Skip to content

Latest commit

 

History

History
12 lines (9 loc) · 476 Bytes

README.md

File metadata and controls

12 lines (9 loc) · 476 Bytes

mod-n

The integers under a modulus, using GHC.TypeLits. Values are not constructed directly, but are calculated by fromInteger. The fact that the Mod type's constructor is not exposed ensures the following invariant:

0 <= fromIntegral (x :: Mod n) < natVal' (proxy# :: Proxy# n)

This package is mostly just an auxilary for bigword. It just seemed like a general (and useful) enough type to exist on its own.