Maintained by
Oleg.GrenrusThis version can be pinned in stack with:bin-0.1.4@sha256:5d95ee06b01a446a2971f2c7ff89741846a7020e620e3713fbe95074df5ebeae,2352
Module documentation for 0.1.4
This package provides binary natural numbers (Data.Bin
);
also utilities to work on the type level with DataKinds
(Data.Type.Bin
).
data Bin
= BZ -- ^ zero
| BP BinP -- ^ non-zero
data BinP
= BE -- ^ one
| B0 BinP -- ^ double
| B1 BinP -- ^ double plus 1
There are ordinals in Data.Bin.Pos
module, as well as
fixed width integers in Data.Wrd
.
Another implementation is at https://hackage.haskell.org/package/nat,
this differs in naming, and provides promoted variant.
Version history for bin
0.1.4
0.1.3
- Add
EqP
and OrdP
instances.
- Add
GShow Pos/P
instances.
- Better ‘PosP.toNatural’ implementation.
0.1.2
- Add
boring
instances
- Add
EqBinP
and EqBin
type families
- Add
NFData
instances
- Add
GEq
, GNFData
, GShow
(from some
package) instances for SBin
and SBinP
.
0.1.1
- Explicitly mark all modules as Safe or Trustworthy.
fin-0.2
support.
0.1
- First version. Released on an unsuspecting world.