typed-digits: Digits, indexed by their base at the type level

[ data, library, mit ] [ Propose Tags ] [ Report a vulnerability ]

Digits, indexed by their base at the type level.

Please see the README, for more details, available on GitHub at https://github.com/arranstewart/hs-typed-digits#readme.


[Skip to Readme]

Flags

Manual Flags

NameDescriptionDefault
noisy

Enable more compilation warnings

Disabled

Use -f <flag> to enable a flag, or -f -<flag> to disable that flag. More info

Downloads

Maintainer's Corner

Package maintainers

For package maintainers and hackage trustees

Candidates

  • No Candidates
Versions [RSS] 0.1.0.0
Change log ChangeLog.md
Dependencies base (>=4.7 && <5), nats, singletons (>=2.3) [details]
Tested with ghc ==8.6.5 || ==8.4.4 || ==8.2.2
License MIT
Copyright 2019 Arran Stewart
Author Arran Stewart
Maintainer haskell-maintenance@arranstewart.info
Category Data
Home page https://github.com/arranstewart/hs-typed-digits#readme
Bug tracker https://github.com/arranstewart/hs-typed-digits/issues
Source repo head: git clone https://github.com/arranstewart/hs-typed-digits
Uploaded by arran at 2019-12-12T10:54:41Z
Distributions
Downloads 424 total (8 in the last 30 days)
Rating (no votes yet) [estimated by Bayesian average]
Your Rating
  • λ
  • λ
  • λ
Status Docs uploaded by user
Build status unknown [no reports yet]

Readme for typed-digits-0.1.0.0

[back to package description]

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