bin: Bin: binary natural numbers.

This is a package candidate release! Here you can preview how this package release will appear once published to the main package index (which can be accomplished via the 'maintain' link below). Please note that once a package has been published to the main package index it cannot be undone! Please consult the package uploading documentation for more information.


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
    | BN BinN  -- ^ non-zero

data BinN
    = BE       -- ^ one
    | B0 BinN  -- ^ double
    | B1 BinN  -- ^ double plus 1

There are ordinals in Data.Bin.Pos module, as well as fixed width integers in Data.Wid.

Another implementation is at, this differs in naming, and provides promoted variant.


Dependenciesbase (>=4.7 && <4.14), dec (>=0.0.3 && <0.1), deepseq (>= && <1.5), fin (>=0.1.1 && <0.2), hashable (>= && <1.4), nats (>=1.1.2 && <1.2) [details]
Copyright(c) 2019 Oleg Grenrus
AuthorOleg Grenrus <>
MaintainerOleg.Grenrus <>
CategoryData, Dependent Types, Singletons, Math
Home page
Bug tracker
Source repositoryhead: git clone
UploadedSun Dec 1 00:48:14 UTC 2019 by phadej



Maintainers' corner

For package maintainers and hackage trustees