@hackage / typed-digits

Digits, indexed by their base at the type level

Latest0.1.0.0

About

Metadata

  • Last updated , by arran
  • License MIT
  • Maintained by: haskell-maintenance@arranstewart.info

  • Lottery factor: 0

Links

Installation

Tested Compilers

  1. 8.6.5
  2. 8.4.4
  3. 8.2.2

Package Flags

Use the -f option with cabal commands to enable flags

    noisy (off by default)

    Enable more compilation warnings

Readme

Build Status Hackage

typed-digits

Provides a Digit type, with the base of the digit available as a type-level Nat. Thus, it can be guaranteed at compile-time that digits of different bases can't be added together.

Usage example

For more convenient provision of type-level parameters, it's recommended to use the DataKinds and TypeApplications extensions. Then, you can give type-level parameters using @, as seen below, instead of giving the full type.

>>> :set -XDataKinds -XTypeApplications
>>> import Data.TypedDigits
>>> let d = digit @9 3
>>> d
Just 3 (base 9)

Source tree contents

  • src: Library source files
  • test: Unit tests
  • doctest: Documentation tests using doctest