Safe Haskell | Safe |
---|---|
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 # | |
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 # gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c BinP # dataTypeOf :: BinP -> DataType # dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c BinP) # dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c BinP) # gmapT :: (forall b. Data b => b -> b) -> BinP -> BinP # gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> BinP -> r # gmapQr :: (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> BinP -> r # gmapQ :: (forall d. Data d => d -> u) -> BinP -> [u] # gmapQi :: Int -> (forall d. Data d => d -> u) -> BinP -> u # gmapM :: Monad m => (forall d. Data d => d -> m d) -> BinP -> m BinP # gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> BinP -> m BinP # gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> BinP -> m BinP # | |
Num BinP Source # | |
Ord BinP Source # |
|
Real BinP Source # | |
Defined in Data.BinP toRational :: BinP -> Rational # | |
Show BinP Source # | |
Function BinP Source # | |
Arbitrary BinP Source # | |
CoArbitrary BinP Source # | |
Bits BinP Source # | NOTE: |
Defined in Data.BinP (.&.) :: BinP -> BinP -> BinP # (.|.) :: BinP -> BinP -> BinP # complement :: BinP -> BinP # shift :: BinP -> Int -> BinP # rotate :: BinP -> Int -> BinP # setBit :: BinP -> Int -> BinP # clearBit :: BinP -> Int -> BinP # complementBit :: BinP -> Int -> BinP # testBit :: BinP -> Int -> Bool # bitSizeMaybe :: BinP -> Maybe Int # shiftL :: BinP -> Int -> BinP # unsafeShiftL :: BinP -> Int -> BinP # shiftR :: BinP -> Int -> BinP # unsafeShiftR :: BinP -> Int -> BinP # rotateL :: BinP -> Int -> BinP # | |
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 #