text-printer-0.5.0.2: Abstract interface for text builders/printers.
Safe HaskellNone
LanguageHaskell2010

Text.Printer.Integral

Description

Print integral numbers in common positional numeral systems.

Synopsis

Positional systems

class PositionalSystem s where Source #

Positional numeral system.

Methods

systemName :: s -> String Source #

The name of the system (e.g. "binary", "decimal").

radixIn :: Num α => s -> α Source #

The radix of the system.

isDigitIn :: s -> Char -> Bool Source #

Test if a character is a digit.

isNzDigitIn :: s -> Char -> Bool Source #

Test if a character is a non-zero digit.

fromDigitIn :: Num α => s -> Char -> Maybe α Source #

Map digits to the corresponding numbers. Return Nothing on other inputs.

fromNzDigitIn :: Num α => s -> Char -> Maybe α Source #

Map non-zero digits to the corresponding numbers. Return Nothing on other inputs.

unsafeFromDigitIn :: Num α => s -> Char -> α Source #

Map digits to the corresponding numbers. No checks are performed.

intToDigitIn :: s -> Int -> Char Source #

Map Int values to the corresponding digits. Inputs must be non-negative and less than the radix.

printDigitIn :: Printer p => s -> Char -> p Source #

Print a digit.

printZeroIn :: Printer p => s -> p Source #

Instances

Instances details
PositionalSystem UpHex Source # 
Instance details

Defined in Text.Printer.Integral

Methods

systemName :: UpHex -> String Source #

radixIn :: Num α => UpHex -> α Source #

isDigitIn :: UpHex -> Char -> Bool Source #

isNzDigitIn :: UpHex -> Char -> Bool Source #

fromDigitIn :: Num α => UpHex -> Char -> Maybe α Source #

fromNzDigitIn :: Num α => UpHex -> Char -> Maybe α Source #

unsafeFromDigitIn :: Num α => UpHex -> Char -> α Source #

intToDigitIn :: UpHex -> Int -> Char Source #

printDigitIn :: Printer p => UpHex -> Char -> p Source #

printZeroIn :: Printer p => UpHex -> p Source #

PositionalSystem LowHex Source # 
Instance details

Defined in Text.Printer.Integral

Methods

systemName :: LowHex -> String Source #

radixIn :: Num α => LowHex -> α Source #

isDigitIn :: LowHex -> Char -> Bool Source #

isNzDigitIn :: LowHex -> Char -> Bool Source #

fromDigitIn :: Num α => LowHex -> Char -> Maybe α Source #

fromNzDigitIn :: Num α => LowHex -> Char -> Maybe α Source #

unsafeFromDigitIn :: Num α => LowHex -> Char -> α Source #

intToDigitIn :: LowHex -> Int -> Char Source #

printDigitIn :: Printer p => LowHex -> Char -> p Source #

printZeroIn :: Printer p => LowHex -> p Source #

PositionalSystem Hexadecimal Source # 
Instance details

Defined in Text.Printer.Integral

Methods

systemName :: Hexadecimal -> String Source #

radixIn :: Num α => Hexadecimal -> α Source #

isDigitIn :: Hexadecimal -> Char -> Bool Source #

isNzDigitIn :: Hexadecimal -> Char -> Bool Source #

fromDigitIn :: Num α => Hexadecimal -> Char -> Maybe α Source #

fromNzDigitIn :: Num α => Hexadecimal -> Char -> Maybe α Source #

unsafeFromDigitIn :: Num α => Hexadecimal -> Char -> α Source #

intToDigitIn :: Hexadecimal -> Int -> Char Source #

printDigitIn :: Printer p => Hexadecimal -> Char -> p Source #

printZeroIn :: Printer p => Hexadecimal -> p Source #

PositionalSystem Decimal Source # 
Instance details

Defined in Text.Printer.Integral

Methods

systemName :: Decimal -> String Source #

radixIn :: Num α => Decimal -> α Source #

isDigitIn :: Decimal -> Char -> Bool Source #

isNzDigitIn :: Decimal -> Char -> Bool Source #

fromDigitIn :: Num α => Decimal -> Char -> Maybe α Source #

fromNzDigitIn :: Num α => Decimal -> Char -> Maybe α Source #

unsafeFromDigitIn :: Num α => Decimal -> Char -> α Source #

intToDigitIn :: Decimal -> Int -> Char Source #

printDigitIn :: Printer p => Decimal -> Char -> p Source #

printZeroIn :: Printer p => Decimal -> p Source #

PositionalSystem Octal Source # 
Instance details

Defined in Text.Printer.Integral

Methods

systemName :: Octal -> String Source #

radixIn :: Num α => Octal -> α Source #

isDigitIn :: Octal -> Char -> Bool Source #

isNzDigitIn :: Octal -> Char -> Bool Source #

fromDigitIn :: Num α => Octal -> Char -> Maybe α Source #

fromNzDigitIn :: Num α => Octal -> Char -> Maybe α Source #

unsafeFromDigitIn :: Num α => Octal -> Char -> α Source #

intToDigitIn :: Octal -> Int -> Char Source #

printDigitIn :: Printer p => Octal -> Char -> p Source #

printZeroIn :: Printer p => Octal -> p Source #

PositionalSystem Binary Source # 
Instance details

Defined in Text.Printer.Integral

Methods

systemName :: Binary -> String Source #

radixIn :: Num α => Binary -> α Source #

isDigitIn :: Binary -> Char -> Bool Source #

isNzDigitIn :: Binary -> Char -> Bool Source #

fromDigitIn :: Num α => Binary -> Char -> Maybe α Source #

fromNzDigitIn :: Num α => Binary -> Char -> Maybe α Source #

unsafeFromDigitIn :: Num α => Binary -> Char -> α Source #

intToDigitIn :: Binary -> Int -> Char Source #

printDigitIn :: Printer p => Binary -> Char -> p Source #

printZeroIn :: Printer p => Binary -> p Source #

class PositionalSystem s => BitSystem s where Source #

Positonal numeral system with a power of two radix.

Methods

digitBitsIn :: s -> Int Source #

Numer of bits occupied by a digit.

digitMaskIn :: Num α => s -> α Source #

The number that has digitBitsIn least significant bits set to ones and all the other bits set to zeroes.

lastDigitIn :: Bits α => s -> α -> Int Source #

Map the last digit of a number to the corresponding Int value.

Instances

Instances details
BitSystem UpHex Source # 
Instance details

Defined in Text.Printer.Integral

Methods

digitBitsIn :: UpHex -> Int Source #

digitMaskIn :: Num α => UpHex -> α Source #

lastDigitIn :: Bits α => UpHex -> α -> Int Source #

BitSystem LowHex Source # 
Instance details

Defined in Text.Printer.Integral

Methods

digitBitsIn :: LowHex -> Int Source #

digitMaskIn :: Num α => LowHex -> α Source #

lastDigitIn :: Bits α => LowHex -> α -> Int Source #

BitSystem Hexadecimal Source # 
Instance details

Defined in Text.Printer.Integral

Methods

digitBitsIn :: Hexadecimal -> Int Source #

digitMaskIn :: Num α => Hexadecimal -> α Source #

lastDigitIn :: Bits α => Hexadecimal -> α -> Int Source #

BitSystem Octal Source # 
Instance details

Defined in Text.Printer.Integral

Methods

digitBitsIn :: Octal -> Int Source #

digitMaskIn :: Num α => Octal -> α Source #

lastDigitIn :: Bits α => Octal -> α -> Int Source #

BitSystem Binary Source # 
Instance details

Defined in Text.Printer.Integral

Methods

digitBitsIn :: Binary -> Int Source #

digitMaskIn :: Num α => Binary -> α Source #

lastDigitIn :: Bits α => Binary -> α -> Int Source #

data Binary Source #

The binary numeral system.

Constructors

Binary 

Instances

Instances details
Eq Binary Source # 
Instance details

Defined in Text.Printer.Integral

Methods

(==) :: Binary -> Binary -> Bool

(/=) :: Binary -> Binary -> Bool

Ord Binary Source # 
Instance details

Defined in Text.Printer.Integral

Methods

compare :: Binary -> Binary -> Ordering

(<) :: Binary -> Binary -> Bool

(<=) :: Binary -> Binary -> Bool

(>) :: Binary -> Binary -> Bool

(>=) :: Binary -> Binary -> Bool

max :: Binary -> Binary -> Binary

min :: Binary -> Binary -> Binary

Read Binary Source # 
Instance details

Defined in Text.Printer.Integral

Methods

readsPrec :: Int -> ReadS Binary

readList :: ReadS [Binary]

readPrec :: ReadPrec Binary

readListPrec :: ReadPrec [Binary]

Show Binary Source # 
Instance details

Defined in Text.Printer.Integral

Methods

showsPrec :: Int -> Binary -> ShowS

show :: Binary -> String

showList :: [Binary] -> ShowS

Generic Binary Source # 
Instance details

Defined in Text.Printer.Integral

Associated Types

type Rep Binary :: Type -> Type

Methods

from :: Binary -> Rep Binary x

to :: Rep Binary x -> Binary

BitSystem Binary Source # 
Instance details

Defined in Text.Printer.Integral

Methods

digitBitsIn :: Binary -> Int Source #

digitMaskIn :: Num α => Binary -> α Source #

lastDigitIn :: Bits α => Binary -> α -> Int Source #

PositionalSystem Binary Source # 
Instance details

Defined in Text.Printer.Integral

Methods

systemName :: Binary -> String Source #

radixIn :: Num α => Binary -> α Source #

isDigitIn :: Binary -> Char -> Bool Source #

isNzDigitIn :: Binary -> Char -> Bool Source #

fromDigitIn :: Num α => Binary -> Char -> Maybe α Source #

fromNzDigitIn :: Num α => Binary -> Char -> Maybe α Source #

unsafeFromDigitIn :: Num α => Binary -> Char -> α Source #

intToDigitIn :: Binary -> Int -> Char Source #

printDigitIn :: Printer p => Binary -> Char -> p Source #

printZeroIn :: Printer p => Binary -> p Source #

type Rep Binary Source # 
Instance details

Defined in Text.Printer.Integral

type Rep Binary = D1 ('MetaData "Binary" "Text.Printer.Integral" "text-printer-0.5.0.2-1aEyTWsmD2GJfkfpMLV1tQ" 'False) (C1 ('MetaCons "Binary" 'PrefixI 'False) (U1 :: Type -> Type))

data Octal Source #

The octal numeral system.

Constructors

Octal 

Instances

Instances details
Eq Octal Source # 
Instance details

Defined in Text.Printer.Integral

Methods

(==) :: Octal -> Octal -> Bool

(/=) :: Octal -> Octal -> Bool

Ord Octal Source # 
Instance details

Defined in Text.Printer.Integral

Methods

compare :: Octal -> Octal -> Ordering

(<) :: Octal -> Octal -> Bool

(<=) :: Octal -> Octal -> Bool

(>) :: Octal -> Octal -> Bool

(>=) :: Octal -> Octal -> Bool

max :: Octal -> Octal -> Octal

min :: Octal -> Octal -> Octal

Read Octal Source # 
Instance details

Defined in Text.Printer.Integral

Methods

readsPrec :: Int -> ReadS Octal

readList :: ReadS [Octal]

readPrec :: ReadPrec Octal

readListPrec :: ReadPrec [Octal]

Show Octal Source # 
Instance details

Defined in Text.Printer.Integral

Methods

showsPrec :: Int -> Octal -> ShowS

show :: Octal -> String

showList :: [Octal] -> ShowS

Generic Octal Source # 
Instance details

Defined in Text.Printer.Integral

Associated Types

type Rep Octal :: Type -> Type

Methods

from :: Octal -> Rep Octal x

to :: Rep Octal x -> Octal

BitSystem Octal Source # 
Instance details

Defined in Text.Printer.Integral

Methods

digitBitsIn :: Octal -> Int Source #

digitMaskIn :: Num α => Octal -> α Source #

lastDigitIn :: Bits α => Octal -> α -> Int Source #

PositionalSystem Octal Source # 
Instance details

Defined in Text.Printer.Integral

Methods

systemName :: Octal -> String Source #

radixIn :: Num α => Octal -> α Source #

isDigitIn :: Octal -> Char -> Bool Source #

isNzDigitIn :: Octal -> Char -> Bool Source #

fromDigitIn :: Num α => Octal -> Char -> Maybe α Source #

fromNzDigitIn :: Num α => Octal -> Char -> Maybe α Source #

unsafeFromDigitIn :: Num α => Octal -> Char -> α Source #

intToDigitIn :: Octal -> Int -> Char Source #

printDigitIn :: Printer p => Octal -> Char -> p Source #

printZeroIn :: Printer p => Octal -> p Source #

type Rep Octal Source # 
Instance details

Defined in Text.Printer.Integral

type Rep Octal = D1 ('MetaData "Octal" "Text.Printer.Integral" "text-printer-0.5.0.2-1aEyTWsmD2GJfkfpMLV1tQ" 'False) (C1 ('MetaCons "Octal" 'PrefixI 'False) (U1 :: Type -> Type))

data Decimal Source #

The decimal numeral system.

Constructors

Decimal 

Instances

Instances details
Eq Decimal Source # 
Instance details

Defined in Text.Printer.Integral

Methods

(==) :: Decimal -> Decimal -> Bool

(/=) :: Decimal -> Decimal -> Bool

Ord Decimal Source # 
Instance details

Defined in Text.Printer.Integral

Methods

compare :: Decimal -> Decimal -> Ordering

(<) :: Decimal -> Decimal -> Bool

(<=) :: Decimal -> Decimal -> Bool

(>) :: Decimal -> Decimal -> Bool

(>=) :: Decimal -> Decimal -> Bool

max :: Decimal -> Decimal -> Decimal

min :: Decimal -> Decimal -> Decimal

Read Decimal Source # 
Instance details

Defined in Text.Printer.Integral

Methods

readsPrec :: Int -> ReadS Decimal

readList :: ReadS [Decimal]

readPrec :: ReadPrec Decimal

readListPrec :: ReadPrec [Decimal]

Show Decimal Source # 
Instance details

Defined in Text.Printer.Integral

Methods

showsPrec :: Int -> Decimal -> ShowS

show :: Decimal -> String

showList :: [Decimal] -> ShowS

Generic Decimal Source # 
Instance details

Defined in Text.Printer.Integral

Associated Types

type Rep Decimal :: Type -> Type

Methods

from :: Decimal -> Rep Decimal x

to :: Rep Decimal x -> Decimal

PositionalSystem Decimal Source # 
Instance details

Defined in Text.Printer.Integral

Methods

systemName :: Decimal -> String Source #

radixIn :: Num α => Decimal -> α Source #

isDigitIn :: Decimal -> Char -> Bool Source #

isNzDigitIn :: Decimal -> Char -> Bool Source #

fromDigitIn :: Num α => Decimal -> Char -> Maybe α Source #

fromNzDigitIn :: Num α => Decimal -> Char -> Maybe α Source #

unsafeFromDigitIn :: Num α => Decimal -> Char -> α Source #

intToDigitIn :: Decimal -> Int -> Char Source #

printDigitIn :: Printer p => Decimal -> Char -> p Source #

printZeroIn :: Printer p => Decimal -> p Source #

type Rep Decimal Source # 
Instance details

Defined in Text.Printer.Integral

type Rep Decimal = D1 ('MetaData "Decimal" "Text.Printer.Integral" "text-printer-0.5.0.2-1aEyTWsmD2GJfkfpMLV1tQ" 'False) (C1 ('MetaCons "Decimal" 'PrefixI 'False) (U1 :: Type -> Type))

data Hexadecimal Source #

The hexadecimal numeral system.

Constructors

Hexadecimal 

Instances

Instances details
Eq Hexadecimal Source # 
Instance details

Defined in Text.Printer.Integral

Methods

(==) :: Hexadecimal -> Hexadecimal -> Bool

(/=) :: Hexadecimal -> Hexadecimal -> Bool

Ord Hexadecimal Source # 
Instance details

Defined in Text.Printer.Integral

Read Hexadecimal Source # 
Instance details

Defined in Text.Printer.Integral

Methods

readsPrec :: Int -> ReadS Hexadecimal

readList :: ReadS [Hexadecimal]

readPrec :: ReadPrec Hexadecimal

readListPrec :: ReadPrec [Hexadecimal]

Show Hexadecimal Source # 
Instance details

Defined in Text.Printer.Integral

Methods

showsPrec :: Int -> Hexadecimal -> ShowS

show :: Hexadecimal -> String

showList :: [Hexadecimal] -> ShowS

Generic Hexadecimal Source # 
Instance details

Defined in Text.Printer.Integral

Associated Types

type Rep Hexadecimal :: Type -> Type

Methods

from :: Hexadecimal -> Rep Hexadecimal x

to :: Rep Hexadecimal x -> Hexadecimal

BitSystem Hexadecimal Source # 
Instance details

Defined in Text.Printer.Integral

Methods

digitBitsIn :: Hexadecimal -> Int Source #

digitMaskIn :: Num α => Hexadecimal -> α Source #

lastDigitIn :: Bits α => Hexadecimal -> α -> Int Source #

PositionalSystem Hexadecimal Source # 
Instance details

Defined in Text.Printer.Integral

Methods

systemName :: Hexadecimal -> String Source #

radixIn :: Num α => Hexadecimal -> α Source #

isDigitIn :: Hexadecimal -> Char -> Bool Source #

isNzDigitIn :: Hexadecimal -> Char -> Bool Source #

fromDigitIn :: Num α => Hexadecimal -> Char -> Maybe α Source #

fromNzDigitIn :: Num α => Hexadecimal -> Char -> Maybe α Source #

unsafeFromDigitIn :: Num α => Hexadecimal -> Char -> α Source #

intToDigitIn :: Hexadecimal -> Int -> Char Source #

printDigitIn :: Printer p => Hexadecimal -> Char -> p Source #

printZeroIn :: Printer p => Hexadecimal -> p Source #

type Rep Hexadecimal Source # 
Instance details

Defined in Text.Printer.Integral

type Rep Hexadecimal = D1 ('MetaData "Hexadecimal" "Text.Printer.Integral" "text-printer-0.5.0.2-1aEyTWsmD2GJfkfpMLV1tQ" 'False) (C1 ('MetaCons "Hexadecimal" 'PrefixI 'False) (U1 :: Type -> Type))

data LowHex Source #

The hexadecimal numeral system, using lower case digits.

Constructors

LowHex 

Instances

Instances details
Eq LowHex Source # 
Instance details

Defined in Text.Printer.Integral

Methods

(==) :: LowHex -> LowHex -> Bool

(/=) :: LowHex -> LowHex -> Bool

Ord LowHex Source # 
Instance details

Defined in Text.Printer.Integral

Methods

compare :: LowHex -> LowHex -> Ordering

(<) :: LowHex -> LowHex -> Bool

(<=) :: LowHex -> LowHex -> Bool

(>) :: LowHex -> LowHex -> Bool

(>=) :: LowHex -> LowHex -> Bool

max :: LowHex -> LowHex -> LowHex

min :: LowHex -> LowHex -> LowHex

Read LowHex Source # 
Instance details

Defined in Text.Printer.Integral

Methods

readsPrec :: Int -> ReadS LowHex

readList :: ReadS [LowHex]

readPrec :: ReadPrec LowHex

readListPrec :: ReadPrec [LowHex]

Show LowHex Source # 
Instance details

Defined in Text.Printer.Integral

Methods

showsPrec :: Int -> LowHex -> ShowS

show :: LowHex -> String

showList :: [LowHex] -> ShowS

Generic LowHex Source # 
Instance details

Defined in Text.Printer.Integral

Associated Types

type Rep LowHex :: Type -> Type

Methods

from :: LowHex -> Rep LowHex x

to :: Rep LowHex x -> LowHex

BitSystem LowHex Source # 
Instance details

Defined in Text.Printer.Integral

Methods

digitBitsIn :: LowHex -> Int Source #

digitMaskIn :: Num α => LowHex -> α Source #

lastDigitIn :: Bits α => LowHex -> α -> Int Source #

PositionalSystem LowHex Source # 
Instance details

Defined in Text.Printer.Integral

Methods

systemName :: LowHex -> String Source #

radixIn :: Num α => LowHex -> α Source #

isDigitIn :: LowHex -> Char -> Bool Source #

isNzDigitIn :: LowHex -> Char -> Bool Source #

fromDigitIn :: Num α => LowHex -> Char -> Maybe α Source #

fromNzDigitIn :: Num α => LowHex -> Char -> Maybe α Source #

unsafeFromDigitIn :: Num α => LowHex -> Char -> α Source #

intToDigitIn :: LowHex -> Int -> Char Source #

printDigitIn :: Printer p => LowHex -> Char -> p Source #

printZeroIn :: Printer p => LowHex -> p Source #

type Rep LowHex Source # 
Instance details

Defined in Text.Printer.Integral

type Rep LowHex = D1 ('MetaData "LowHex" "Text.Printer.Integral" "text-printer-0.5.0.2-1aEyTWsmD2GJfkfpMLV1tQ" 'False) (C1 ('MetaCons "LowHex" 'PrefixI 'False) (U1 :: Type -> Type))

data UpHex Source #

The hexadecimal numeral system, using upper case digits.

Constructors

UpHex 

Instances

Instances details
Eq UpHex Source # 
Instance details

Defined in Text.Printer.Integral

Methods

(==) :: UpHex -> UpHex -> Bool

(/=) :: UpHex -> UpHex -> Bool

Ord UpHex Source # 
Instance details

Defined in Text.Printer.Integral

Methods

compare :: UpHex -> UpHex -> Ordering

(<) :: UpHex -> UpHex -> Bool

(<=) :: UpHex -> UpHex -> Bool

(>) :: UpHex -> UpHex -> Bool

(>=) :: UpHex -> UpHex -> Bool

max :: UpHex -> UpHex -> UpHex

min :: UpHex -> UpHex -> UpHex

Read UpHex Source # 
Instance details

Defined in Text.Printer.Integral

Methods

readsPrec :: Int -> ReadS UpHex

readList :: ReadS [UpHex]

readPrec :: ReadPrec UpHex

readListPrec :: ReadPrec [UpHex]

Show UpHex Source # 
Instance details

Defined in Text.Printer.Integral

Methods

showsPrec :: Int -> UpHex -> ShowS

show :: UpHex -> String

showList :: [UpHex] -> ShowS

Generic UpHex Source # 
Instance details

Defined in Text.Printer.Integral

Associated Types

type Rep UpHex :: Type -> Type

Methods

from :: UpHex -> Rep UpHex x

to :: Rep UpHex x -> UpHex

BitSystem UpHex Source # 
Instance details

Defined in Text.Printer.Integral

Methods

digitBitsIn :: UpHex -> Int Source #

digitMaskIn :: Num α => UpHex -> α Source #

lastDigitIn :: Bits α => UpHex -> α -> Int Source #

PositionalSystem UpHex Source # 
Instance details

Defined in Text.Printer.Integral

Methods

systemName :: UpHex -> String Source #

radixIn :: Num α => UpHex -> α Source #

isDigitIn :: UpHex -> Char -> Bool Source #

isNzDigitIn :: UpHex -> Char -> Bool Source #

fromDigitIn :: Num α => UpHex -> Char -> Maybe α Source #

fromNzDigitIn :: Num α => UpHex -> Char -> Maybe α Source #

unsafeFromDigitIn :: Num α => UpHex -> Char -> α Source #

intToDigitIn :: UpHex -> Int -> Char Source #

printDigitIn :: Printer p => UpHex -> Char -> p Source #

printZeroIn :: Printer p => UpHex -> p Source #

type Rep UpHex Source # 
Instance details

Defined in Text.Printer.Integral

type Rep UpHex = D1 ('MetaData "UpHex" "Text.Printer.Integral" "text-printer-0.5.0.2-1aEyTWsmD2GJfkfpMLV1tQ" 'False) (C1 ('MetaCons "UpHex" 'PrefixI 'False) (U1 :: Type -> Type))

Numeral printers

nonNegative :: (PositionalSystem s, Integral α, Printer p) => s -> α -> p Source #

Print a non-negative number in the specified positional numeral system.

nnBinary :: (Integral α, Printer p) => α -> p Source #

Print a non-negative number in the binary numeral system.

nnOctal :: (Integral α, Printer p) => α -> p Source #

Print a non-negative number in the octal numeral system.

nnDecimal :: (Integral α, Printer p) => α -> p Source #

Print a non-negative number in the decimal numeral system.

nnLowHex :: (Integral α, Printer p) => α -> p Source #

Print a non-negative number in the hexadecimal numeral system using lower case digits.

nnUpHex :: (Integral α, Printer p) => α -> p Source #

Print a non-negative number in the hexadecimal numeral system using upper case digits.

nnBits :: (BitSystem s, Num α, Bits α, Printer p) => s -> α -> p Source #

Print a non-negative binary number in the specified positional numeral system.

nnBinaryBits :: (Num α, Bits α, Printer p) => α -> p Source #

Print a non-negative binary number in the binary numeral system.

nnOctalBits :: (Num α, Bits α, Printer p) => α -> p Source #

Print a non-negative binary number in the octal numeral system.

nnLowHexBits :: (Num α, Bits α, Printer p) => α -> p Source #

Print a non-negative binary number in the hexadecimal numeral system using lower case digits.

nnUpHexBits :: (Num α, Bits α, Printer p) => α -> p Source #

Print a non-negative binary number in the hexadecimal numeral system using upper case digits.

nonPositive :: (PositionalSystem s, Integral α, Printer p) => s -> α -> p Source #

Print a non-positive number in the specified positional numeral system. For example, nonPositive Decimal (-123) would print "123".

npBinary :: (Integral α, Printer p) => α -> p Source #

Print a non-positive number in the binary numeral system.

npOctal :: (Integral α, Printer p) => α -> p Source #

Print a non-positive number in the octal numeral system.

npDecimal :: (Integral α, Printer p) => α -> p Source #

Print a non-positive number in the decimal numeral system.

npLowHex :: (Integral α, Printer p) => α -> p Source #

Print a non-positive number in the hexadecimal numeral system using lower case digits.

npUpHex :: (Integral α, Printer p) => α -> p Source #

Print a non-positive number in the hexadecimal numeral system using upper case digits.

npBits :: (BitSystem s, Ord α, Num α, Bits α, Printer p) => s -> α -> p Source #

Print a non-positive two-compliment binary number in the specified positional numeral system. For example, npBits UpHex (-0xABC) would print "ABC".

npBinaryBits :: (Ord α, Num α, Bits α, Printer p) => α -> p Source #

Print a non-positive binary number in the binary numeral system.

npOctalBits :: (Ord α, Num α, Bits α, Printer p) => α -> p Source #

Print a non-positive binary number in the octal numeral system.

npLowHexBits :: (Ord α, Num α, Bits α, Printer p) => α -> p Source #

Print a non-positive binary number in the hexadecimal numeral system using lower case digits.

npUpHexBits :: (Ord α, Num α, Bits α, Printer p) => α -> p Source #

Print a non-positive binary number in the hexadecimal numeral system using upper case digits.

number' Source #

Arguments

:: (PositionalSystem s, Integral α, Printer p) 
=> s 
-> p

Prefix for negative values

-> p

Zero printer

-> p

Prefix for positive values

-> α 
-> p 

Print a number in the specified positional numeral system.

number :: (PositionalSystem s, Integral α, Printer p) => s -> α -> p Source #

Print a number in the specified positional numeral system. Negative values are prefixed with a minus sign.

binary' Source #

Arguments

:: (Integral α, Printer p) 
=> p

Prefix for negative values

-> p

Zero printer

-> p

Prefix for positive values

-> α 
-> p 

Print a number in the binary numeral system.

binary :: (Integral α, Printer p) => α -> p Source #

Print a number in the binary numeral system. Negative values are prefixed with a minus sign.

octal' Source #

Arguments

:: (Integral α, Printer p) 
=> p

Prefix for negative values

-> p

Zero printer

-> p

Prefix for positive values

-> α 
-> p 

Print a number in the octal numeral system.

octal :: (Integral α, Printer p) => α -> p Source #

Print a number in the octal numeral system. Negative values are prefixed with a minus sign.

decimal' Source #

Arguments

:: (Integral α, Printer p) 
=> p

Prefix for negative values

-> p

Zero printer

-> p

Prefix for positive values

-> α 
-> p 

Print a number in the decimal numeral system.

decimal :: (Integral α, Printer p) => α -> p Source #

Print a number in the decimal numeral system. Negative values are prefixed with a minus sign.

lowHex' Source #

Arguments

:: (Integral α, Printer p) 
=> p

Prefix for negative values

-> p

Zero printer

-> p

Prefix for positive values

-> α 
-> p 

Print a number in the hexadecimal numeral system using lower case digits.

lowHex :: (Integral α, Printer p) => α -> p Source #

Print a number in the hexadecimal numeral system using lower case digits. Negative values are prefixed with a minus sign.

upHex' Source #

Arguments

:: (Integral α, Printer p) 
=> p

Prefix for negative values

-> p

Zero printer

-> p

Prefix for positive values

-> α 
-> p 

Print a number in the hexadecimal numeral system using upper case digits.

upHex :: (Integral α, Printer p) => α -> p Source #

Print a number in the hexadecimal numeral system using upper case digits. Negative values are prefixed with a minus sign.

bits' Source #

Arguments

:: (BitSystem s, Ord α, Num α, Bits α, Printer p) 
=> s 
-> p

Prefix for negative values

-> p

Zero printer

-> p

Prefix for positive values

-> α 
-> p 

Print a binary number in the specified positional numeral system.

bits :: (BitSystem s, Ord α, Num α, Bits α, Printer p) => s -> α -> p Source #

Print a binary number in the specified positional numeral system. Negative values are prefixed with a minus sign.

binaryBits' Source #

Arguments

:: (Ord α, Num α, Bits α, Printer p) 
=> p

Prefix for negative values

-> p

Zero printer

-> p

Prefix for positive values

-> α 
-> p 

Print a binary number in the binary numeral system.

binaryBits :: (Ord α, Num α, Bits α, Printer p) => α -> p Source #

Print a binary number in the binary numeral system. Negative values are prefixed with a minus sign.

octalBits' Source #

Arguments

:: (Ord α, Num α, Bits α, Printer p) 
=> p

Prefix for negative values

-> p

Zero printer

-> p

Prefix for positive values

-> α 
-> p 

Print a binary number in the octal numeral system.

octalBits :: (Ord α, Num α, Bits α, Printer p) => α -> p Source #

Print a binary number in the octal numeral system. Negative values are prefixed with a minus sign.

lowHexBits' Source #

Arguments

:: (Ord α, Num α, Bits α, Printer p) 
=> p

Prefix for negative values

-> p

Zero printer

-> p

Prefix for positive values

-> α 
-> p 

Print a binary number in the hexadecimal numeral system using lower case digits.

lowHexBits :: (Ord α, Num α, Bits α, Printer p) => α -> p Source #

Print a binary number in the hexadecimal numeral system using lower case digits. Negative values are prefixed with a minus sign.

upHexBits' Source #

Arguments

:: (Ord α, Num α, Bits α, Printer p) 
=> p

Prefix for negative values

-> p

Zero printer

-> p

Prefix for positive values

-> α 
-> p 

Print a binary number in the hexadecimal numeral system using upper case digits.

upHexBits :: (Ord α, Num α, Bits α, Printer p) => α -> p Source #

Print a binary number in the hexadecimal numeral system using upper case digits. Negative values are prefixed with a minus sign.