cabal-version:      2.2
name:               bin
version:            0.1.1
synopsis:           Bin: binary natural numbers.
category:           Data, Dependent Types, Singletons, Math
description:
  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.

homepage:           https://github.com/phadej/vec
bug-reports:        https://github.com/phadej/vec/issues
license:            GPL-2.0-or-later
license-file:       LICENSE
author:             Oleg Grenrus <oleg.grenrus@iki.fi>
maintainer:         Oleg.Grenrus <oleg.grenrus@iki.fi>
copyright:          (c) 2019-2021 Oleg Grenrus
build-type:         Simple
extra-source-files: ChangeLog.md
tested-with:
  GHC ==7.8.4
   || ==7.10.3
   || ==8.0.2
   || ==8.2.2
   || ==8.4.4
   || ==8.6.5
   || ==8.8.4
   || ==8.10.4
   || ==9.0.1

source-repository head
  type:     git
  location: https://github.com/phadej/vec.git
  subdir:   bin

library
  default-language: Haskell2010
  hs-source-dirs:   src
  ghc-options:      -Wall -fprint-explicit-kinds
  exposed-modules:
    Data.Bin
    Data.Bin.Pos
    Data.BinP
    Data.BinP.PosP
    Data.Type.Bin
    Data.Type.BinP
    Data.Wrd

  other-modules:    TrustworthyCompat
  build-depends:
    , base        >=4.7     && <4.16
    , dec         ^>=0.0.3
    , deepseq     >=1.3.0.2 && <1.5
    , fin         ^>=0.2
    , hashable    >=1.2.7.0 && <1.4
    , QuickCheck  ^>=2.14.2

  if !impl(ghc >=7.10)
    build-depends: nats ^>=1.1.2

  if impl(ghc >= 9.0)
    -- these flags may abort compilation with GHC-8.10
    -- https://gitlab.haskell.org/ghc/ghc/-/merge_requests/3295
    ghc-options: -Winferred-safe-imports -Wmissing-safe-haskell-mode

-- dump-core
-- if impl(ghc >= 8.0)
--  build-depends: dump-core
--  ghc-options: -fplugin=DumpCore -fplugin-opt DumpCore:core-html