bin-0.1: Bin: binary natural numbers.
Safe Haskell None
Language Haskell2010

Data.BinP.PosP

Synopsis

Documentation

data PosP' (n :: Nat ) (b :: BinP ) where Source #

PosP' is a structure inside PosP .

Constructors

AtEnd

Fields

Here

Fields

There1

Fields

There0

Fields

Instances

Instances details
( SNatI n, SBinPI b) => Bounded ( PosP' n b) Source #
Instance details

Defined in Data.BinP.PosP

Eq ( PosP' n b) Source #
Instance details

Defined in Data.BinP.PosP

Ord ( PosP' n b) Source #
Instance details

Defined in Data.BinP.PosP

SNatI n => Show ( PosP' n b) Source #
Instance details

Defined in Data.BinP.PosP

( SNatI n, SBinPI b) => Function ( PosP' n b) Source #
Instance details

Defined in Data.BinP.PosP

Methods

function :: ( PosP' n b -> b0) -> PosP' n b :-> b0 Source #

( SNatI n, SBinPI b) => Arbitrary ( PosP' n b) Source #
Instance details

Defined in Data.BinP.PosP

SNatI n => CoArbitrary ( PosP' n b) Source #
Instance details

Defined in Data.BinP.PosP

Top & Pop

top :: SBinPI b => PosP b Source #

top and pop serve as FZ and FS , with types specified so type-inference works backwards from the result.

>>> top :: PosP BinP4
0
>>> pop (pop top) :: PosP BinP4
2
>>> pop (pop top) :: PosP BinP9
2

Showing

Conversions

Interesting

boring :: PosP ' BE Source #

Counting to one is boring

>>> boring
0

Weakening (succ)

Universe

universe :: forall b. SBinPI b => [ PosP b] Source #

>>> universe :: [PosP BinP9]
[0,1,2,3,4,5,6,7,8]

universe' :: forall b n. ( SNatI n, SBinPI b) => [ PosP' n b] Source #

This gives a hint, what the n parameter means in PosP' .

>>> universe' :: [PosP' N.Nat2 BinP2]
[0,1,2,3,4,5,6,7]