Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell2010 |
Positive binary natural numbers,
BinP
.
This module is designed to be imported qualified.
Synopsis
- data BinP
- cata :: a -> (a -> a) -> (a -> a) -> BinP -> a
- toNatural :: BinP -> Natural
- fromNatural :: Natural -> BinP
- toNat :: BinP -> Nat
- explicitShow :: BinP -> String
- explicitShowsPrec :: Int -> BinP -> ShowS
- predMaybe :: BinP -> Maybe BinP
- binP1 :: BinP
- binP2 :: BinP
- binP3 :: BinP
- binP4 :: BinP
- binP5 :: BinP
- binP6 :: BinP
- binP7 :: BinP
- binP8 :: BinP
- binP9 :: BinP
Documentation
Non-zero binary natural numbers.
We could have called this type
Bin1
,
but that's used as type alias for promoted
in
Data.Type.Bin
.
BP
BE
Instances
Enum BinP Source # | |
Eq BinP Source # | |
Integral BinP Source # | |
Defined in Data.BinP |
|
Data BinP Source # | |
Defined in Data.BinP 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 # | |
Ord BinP Source # |
|
Real BinP Source # | |
Show BinP Source # | |
Function BinP Source # | |
Arbitrary BinP Source # | |
CoArbitrary BinP Source # | |
Bits BinP Source # |
NOTE
:
|
Defined in Data.BinP (.&.) :: BinP -> BinP -> BinP Source # (.|.) :: BinP -> BinP -> BinP Source # xor :: BinP -> BinP -> BinP Source # complement :: BinP -> BinP Source # shift :: BinP -> Int -> BinP Source # rotate :: BinP -> Int -> BinP Source # setBit :: BinP -> Int -> BinP Source # clearBit :: BinP -> Int -> BinP Source # complementBit :: BinP -> Int -> BinP Source # testBit :: BinP -> Int -> Bool Source # bitSizeMaybe :: BinP -> Maybe Int Source # bitSize :: BinP -> Int Source # isSigned :: BinP -> Bool Source # shiftL :: BinP -> Int -> BinP Source # unsafeShiftL :: BinP -> Int -> BinP Source # shiftR :: BinP -> Int -> BinP Source # unsafeShiftR :: BinP -> Int -> BinP Source # rotateL :: BinP -> Int -> BinP Source # |
|
NFData BinP Source # | |
Hashable BinP Source # | |
TestEquality SBinP Source # | |
Defined in Data.Type.BinP |
Conversions
fromNatural :: Natural -> BinP Source #
fromNatural
for
BinP
.
Throws when given 0.
Showing
explicitShow :: BinP -> String Source #