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
Arbitrary BinP Source # | |
CoArbitrary BinP Source # | |
Function 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 :: forall r r'. (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 # | |
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 # | |
Enum BinP Source # | |
Num BinP Source # | |
Integral BinP Source # | |
Real BinP Source # | |
Defined in Data.BinP toRational :: BinP -> Rational # | |
Show BinP Source # | |
NFData BinP Source # | |
Eq BinP Source # | |
Ord BinP Source # |
|
Hashable BinP Source # | |
TestEquality SBinP Source # | |
Defined in Data.Type.BinP | |
EqP PosP Source # | Since: 0.1.3 |
EqP SBinP Source # | Since: 0.1.3 |
GNFData SBinP Source # | Since: 0.1.2 |
Defined in Data.Type.BinP | |
GEq SBinP Source # | Since: 0.1.2 |
GShow PosP Source # | Since: 0.1.3 |
Defined in Data.BinP.PosP gshowsPrec :: forall (a :: k). Int -> PosP a -> ShowS # | |
GShow SBinP Source # | Since: 0.1.2 |
Defined in Data.Type.BinP gshowsPrec :: forall (a :: k). Int -> SBinP a -> ShowS # | |
OrdP PosP Source # | Since: 0.1.3 |
SNatI n => GShow (PosP' n :: BinP -> Type) Source # | Since: 0.1.3 |
Defined in Data.BinP.PosP gshowsPrec :: forall (a :: k). Int -> PosP' n a -> ShowS # |
Conversions
fromNatural :: Natural -> BinP Source #
fromNatural
for BinP
.
Throws when given 0.
Showing
explicitShow :: BinP -> String Source #