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

Data.BinP

Description

Positive binary natural numbers, BinP .

This module is designed to be imported qualified.

Synopsis

Documentation

data BinP Source #

Non-zero binary natural numbers.

We could have called this type Bin1 , but that's used as type alias for promoted BP BE in Data.Type.Bin .

Constructors

BE

one

B0 BinP

mult2

B1 BinP

mult2 plus 1

Instances

Instances details
Enum BinP Source #
Instance details

Defined in Data.BinP

Eq BinP Source #
Instance details

Defined in Data.BinP

Integral BinP Source #
Instance details

Defined in Data.BinP

Data BinP Source #
Instance details

Defined in Data.BinP

Methods

gfoldl :: ( forall d b. Data d => c (d -> b) -> d -> c b) -> ( forall g. g -> c g) -> BinP -> c BinP Source #

gunfold :: ( forall b r. Data b => c (b -> r) -> c r) -> ( forall r. r -> c r) -> Constr -> c BinP Source #

toConstr :: BinP -> Constr Source #

dataTypeOf :: BinP -> DataType Source #

dataCast1 :: Typeable t => ( forall d. Data d => c (t d)) -> Maybe (c BinP ) Source #

dataCast2 :: Typeable t => ( forall d e. ( Data d, Data e) => c (t d e)) -> Maybe (c BinP ) Source #

gmapT :: ( forall b. Data b => b -> b) -> BinP -> BinP Source #

gmapQl :: (r -> r' -> r) -> r -> ( forall d. Data d => d -> r') -> BinP -> r Source #

gmapQr :: forall r r'. (r' -> r -> r) -> r -> ( forall d. Data d => d -> r') -> BinP -> r Source #

gmapQ :: ( forall d. Data d => d -> u) -> BinP -> [u] Source #

gmapQi :: Int -> ( forall d. Data d => d -> u) -> BinP -> u Source #

gmapM :: Monad m => ( forall d. Data d => d -> m d) -> BinP -> m BinP Source #

gmapMp :: MonadPlus m => ( forall d. Data d => d -> m d) -> BinP -> m BinP Source #

gmapMo :: MonadPlus m => ( forall d. Data d => d -> m d) -> BinP -> m BinP Source #

Num BinP Source #
Instance details

Defined in Data.BinP

Ord BinP Source #
>>> sort [1 .. 9 :: BinP]
[1,2,3,4,5,6,7,8,9]
Instance details

Defined in Data.BinP

Real BinP Source #
Instance details

Defined in Data.BinP

Show BinP Source #
Instance details

Defined in Data.BinP

Function BinP Source #
Instance details

Defined in Data.BinP

Arbitrary BinP Source #
Instance details

Defined in Data.BinP

CoArbitrary BinP Source #
Instance details

Defined in Data.BinP

Bits BinP Source #

NOTE : .&. , xor , shiftR and rotateR are __NOT_ implemented. They may make number zero.

Instance details

Defined in Data.BinP

NFData BinP Source #
Instance details

Defined in Data.BinP

Hashable BinP Source #
Instance details

Defined in Data.BinP

TestEquality SBinP Source #
Instance details

Defined in Data.Type.BinP

Methods

testEquality :: forall (a :: k) (b :: k). SBinP a -> SBinP b -> Maybe (a :~: b) Source #

Conversions

cata Source #

Arguments

:: a

\(1\)

-> (a -> a)

\(2x\)

-> (a -> a)

\(2x + 1\)

-> BinP
-> a

Fold BinP .

Showing

explicitShow :: BinP -> String Source #

show displaying a structure of BinP .

>>> explicitShow 11
"B1 (B1 (B0 BE))"

Extras

Aliases