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]

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 https://hackage.haskell.org/package/nat, this differs in naming, and provides promoted variant.

Properties

Version0.1
Change logChangeLog.md
Dependenciesbase (>=4.7 && <4.14), dec (>=0.0.3 && <0.1), deepseq (>=1.3.0.2 && <1.5), fin (>=0.1.1 && <0.2), hashable (>=1.2.7.0 && <1.4), nats (>=1.1.2 && <1.2) [details]
LicenseGPL-2.0-or-later
Copyright(c) 2019 Oleg Grenrus
AuthorOleg Grenrus <oleg.grenrus@iki.fi>
MaintainerOleg.Grenrus <oleg.grenrus@iki.fi>
CategoryData, Dependent Types, Singletons, Math
Home pagehttps://github.com/phadej/vec
Bug trackerhttps://github.com/phadej/vec/issues
Source repositoryhead: git clone https://github.com/phadej/vec.git(bin)
UploadedSun Dec 1 00:48:14 UTC 2019 by phadej

Modules

Downloads

Maintainers' corner

For package maintainers and hackage trustees