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.

[maintain] [Publish]

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, this differs in naming, and provides promoted variant.


Versions 0.1, 0.1, 0.1.1, 0.1.2, 0.1.3, 0.1.4
Change log
Dependencies base (>=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), QuickCheck (>=2.13.2 && <2.14) [details]
License GPL-2.0-or-later
Copyright (c) 2019 Oleg Grenrus
Author Oleg Grenrus <>
Maintainer Oleg.Grenrus <>
Category Data, Dependent Types, Singletons, Math
Home page
Bug tracker
Source repo head: git clone
Uploaded by phadej at 2019-12-13T13:38:04Z


[Index] [Quick Jump]


Maintainer's Corner

Package maintainers

For package maintainers and hackage trustees