d10: Digits 0-9
Data types representing the digits zero through nine.
Modules
Each of the following modules defines a different type named
D10
, all of which are different representations of the same
concept:
D10.Char - Defines a
D10
type as a newtype forChar
, where the values are restricted to characters between'0'
and'9'
D10.Num - Defines a
D10
type as a newtype for any type with an instance of theNum
class, where the values are restricted to numbers betweenfromInteger 0
andfromInteger 9
D10.Safe - Defines a
D10
type asD0 | D1 | D2 | ... | D9
The Arithmetic
modules provide infix operators (+
), (-
), (*
)
for modular arithmetic:
The following modules export constructors that can be used incorrectly:
Functions to test whether values of various types represent digits in the range 0 to 9:
Quasi-quoters
The D10.Char and D10.Num modules include quasi-quoters named
d10
used to express single digits. For example, 7 can be written as[d10|7|]
. This is an important feature because theD10
types defined in these modules have unsafe constructors, and the quasi-quoters provide compile-time assurance that we never construct aD10
that represents a value outside the range 0 to 9.D10.Char, D10.Num, and D10.Safe include quasi-quoters named
d10list
to express lists of digits. For example, [4, 5, 6] can be written as[d10list|456|]
.
[Skip to Readme]
Downloads
- d10-1.tar.gz [browse] (Cabal source package)
- Package description (as included in the package)
Maintainer's Corner
For package maintainers and hackage trustees
Candidates
- No Candidates
Versions [RSS] | 0.1.0.0, 0.1.0.1, 0.1.1.0, 0.2.0.1, 0.2.1.0, 0.2.1.2, 0.2.1.4, 0.2.1.6, 0.3, 0.3.0.1, 1, 1.0.0.1, 1.0.0.2, 1.0.1.0, 1.0.1.1, 1.0.1.2, 1.0.1.3 |
---|---|
Change log | CHANGELOG.md |
Dependencies | base (>=4.10 && <4.16), template-haskell (>=2.12 && <2.18) [details] |
Tested with | ghc ==8.2.2, ghc ==8.4.3, ghc ==8.6.1, ghc ==8.8.1, ghc ==8.10.1, ghc ==9.0.1 |
License | MIT |
Copyright | 2018-2021 Mission Valley Software LLC |
Author | Chris Martin |
Maintainer | Chris Martin, Julie Moronuki |
Category | Data |
Home page | https://github.com/typeclasses/d10 |
Bug tracker | https://github.com/typeclasses/d10/issues |
Source repo | head: git clone https://github.com/typeclasses/d10 |
Uploaded | by chris_martin at 2021-07-14T07:57:38Z |
Distributions | |
Reverse Dependencies | 2 direct, 3998 indirect [details] |
Downloads | 4699 total (46 in the last 30 days) |
Rating | 2.0 (votes: 1) [estimated by Bayesian average] |
Your Rating | |
Status | Docs available [build log] Last success reported on 2021-07-14 [all 1 reports] |