web3-bignum-1.0.0.0: Fixed size big integers for Haskell Web3 library.
CopyrightAleksandr Krupenkin 2016-2021
LicenseApache-2.0
Maintainermail@akru.me
Stabilityexperimental
Portabilityunportable
Safe HaskellNone
LanguageHaskell2010

Data.BigNum

Description

Big numbers and codecs for Haskell Web3 library.

Synopsis

Documentation

data Word256 #

Instances

Instances details
Bounded Word256 
Instance details

Defined in Data.WideWord.Word256

Enum Word256 
Instance details

Defined in Data.WideWord.Word256

Eq Word256 
Instance details

Defined in Data.WideWord.Word256

Methods

(==) :: Word256 -> Word256 -> Bool #

(/=) :: Word256 -> Word256 -> Bool #

Integral Word256 
Instance details

Defined in Data.WideWord.Word256

Data Word256 
Instance details

Defined in Data.WideWord.Word256

Methods

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

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

toConstr :: Word256 -> Constr #

dataTypeOf :: Word256 -> DataType #

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

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

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

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

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

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

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

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

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

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

Num Word256 
Instance details

Defined in Data.WideWord.Word256

Ord Word256 
Instance details

Defined in Data.WideWord.Word256

Read Word256 
Instance details

Defined in Data.WideWord.Word256

Real Word256 
Instance details

Defined in Data.WideWord.Word256

Show Word256 
Instance details

Defined in Data.WideWord.Word256

Ix Word256 
Instance details

Defined in Data.WideWord.Word256

Generic Word256 
Instance details

Defined in Data.WideWord.Word256

Associated Types

type Rep Word256 :: Type -> Type #

Methods

from :: Word256 -> Rep Word256 x #

to :: Rep Word256 x -> Word256 #

Storable Word256 
Instance details

Defined in Data.WideWord.Word256

Bits Word256 
Instance details

Defined in Data.WideWord.Word256

FiniteBits Word256 
Instance details

Defined in Data.WideWord.Word256

NFData Word256 
Instance details

Defined in Data.WideWord.Word256

Methods

rnf :: Word256 -> () #

Prim Word256 
Instance details

Defined in Data.WideWord.Word256

Encode Word256 Source # 
Instance details

Defined in Data.BigNum

Methods

put :: Putter Word256 #

Decode Word256 Source # 
Instance details

Defined in Data.BigNum

Methods

get :: Get Word256 #

type Rep Word256 
Instance details

Defined in Data.WideWord.Word256

type Rep Word256 = D1 ('MetaData "Word256" "Data.WideWord.Word256" "wide-word-0.1.1.2-6qI5XFLekyaDmQVTTcryzz" 'False) (C1 ('MetaCons "Word256" 'PrefixI 'True) ((S1 ('MetaSel ('Just "word256hi") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 Word64) :*: S1 ('MetaSel ('Just "word256m1") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 Word64)) :*: (S1 ('MetaSel ('Just "word256m0") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 Word64) :*: S1 ('MetaSel ('Just "word256lo") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 Word64))))

data Word128 #

Instances

Instances details
Bounded Word128 
Instance details

Defined in Data.WideWord.Word128

Enum Word128 
Instance details

Defined in Data.WideWord.Word128

Eq Word128 
Instance details

Defined in Data.WideWord.Word128

Methods

(==) :: Word128 -> Word128 -> Bool #

(/=) :: Word128 -> Word128 -> Bool #

Integral Word128 
Instance details

Defined in Data.WideWord.Word128

Data Word128 
Instance details

Defined in Data.WideWord.Word128

Methods

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

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

toConstr :: Word128 -> Constr #

dataTypeOf :: Word128 -> DataType #

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

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

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

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

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

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

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

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

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

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

Num Word128 
Instance details

Defined in Data.WideWord.Word128

Ord Word128 
Instance details

Defined in Data.WideWord.Word128

Read Word128 
Instance details

Defined in Data.WideWord.Word128

Real Word128 
Instance details

Defined in Data.WideWord.Word128

Show Word128 
Instance details

Defined in Data.WideWord.Word128

Ix Word128 
Instance details

Defined in Data.WideWord.Word128

Generic Word128 
Instance details

Defined in Data.WideWord.Word128

Associated Types

type Rep Word128 :: Type -> Type #

Methods

from :: Word128 -> Rep Word128 x #

to :: Rep Word128 x -> Word128 #

Storable Word128 
Instance details

Defined in Data.WideWord.Word128

Bits Word128 
Instance details

Defined in Data.WideWord.Word128

FiniteBits Word128 
Instance details

Defined in Data.WideWord.Word128

NFData Word128 
Instance details

Defined in Data.WideWord.Word128

Methods

rnf :: Word128 -> () #

Prim Word128 
Instance details

Defined in Data.WideWord.Word128

Encode Word128 Source # 
Instance details

Defined in Data.BigNum

Methods

put :: Putter Word128 #

Decode Word128 Source # 
Instance details

Defined in Data.BigNum

Methods

get :: Get Word128 #

type Rep Word128 
Instance details

Defined in Data.WideWord.Word128

type Rep Word128 = D1 ('MetaData "Word128" "Data.WideWord.Word128" "wide-word-0.1.1.2-6qI5XFLekyaDmQVTTcryzz" 'False) (C1 ('MetaCons "Word128" 'PrefixI 'True) (S1 ('MetaSel ('Just "word128Hi64") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 Word64) :*: S1 ('MetaSel ('Just "word128Lo64") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 Word64)))

data H160 Source #

20 byte of data.

Instances

Instances details
Eq H160 Source # 
Instance details

Defined in Data.BigNum

Methods

(==) :: H160 -> H160 -> Bool #

(/=) :: H160 -> H160 -> Bool #

Ord H160 Source # 
Instance details

Defined in Data.BigNum

Methods

compare :: H160 -> H160 -> Ordering #

(<) :: H160 -> H160 -> Bool #

(<=) :: H160 -> H160 -> Bool #

(>) :: H160 -> H160 -> Bool #

(>=) :: H160 -> H160 -> Bool #

max :: H160 -> H160 -> H160 #

min :: H160 -> H160 -> H160 #

Show H160 Source # 
Instance details

Defined in Data.BigNum

Methods

showsPrec :: Int -> H160 -> ShowS #

show :: H160 -> String #

showList :: [H160] -> ShowS #

IsString H160 Source # 
Instance details

Defined in Data.BigNum

Methods

fromString :: String -> H160 #

ByteArrayAccess H160 Source # 
Instance details

Defined in Data.BigNum

Methods

length :: H160 -> Int #

withByteArray :: H160 -> (Ptr p -> IO a) -> IO a #

copyByteArrayToPtr :: H160 -> Ptr p -> IO () #

ToHex H160 Source # 
Instance details

Defined in Data.BigNum

Methods

toHex :: H160 -> HexString #

FromHex H160 Source # 
Instance details

Defined in Data.BigNum

Encode H160 Source # 
Instance details

Defined in Data.BigNum

Methods

put :: Putter H160 #

Decode H160 Source # 
Instance details

Defined in Data.BigNum

Methods

get :: Get H160 #

h160 :: ByteArrayAccess a => a -> Maybe H160 Source #

Convert any 20 byte array into H160 type, otherwise returns Nothing.

data H256 Source #

32 byte of data.

Instances

Instances details
Eq H256 Source # 
Instance details

Defined in Data.BigNum

Methods

(==) :: H256 -> H256 -> Bool #

(/=) :: H256 -> H256 -> Bool #

Ord H256 Source # 
Instance details

Defined in Data.BigNum

Methods

compare :: H256 -> H256 -> Ordering #

(<) :: H256 -> H256 -> Bool #

(<=) :: H256 -> H256 -> Bool #

(>) :: H256 -> H256 -> Bool #

(>=) :: H256 -> H256 -> Bool #

max :: H256 -> H256 -> H256 #

min :: H256 -> H256 -> H256 #

Show H256 Source # 
Instance details

Defined in Data.BigNum

Methods

showsPrec :: Int -> H256 -> ShowS #

show :: H256 -> String #

showList :: [H256] -> ShowS #

IsString H256 Source # 
Instance details

Defined in Data.BigNum

Methods

fromString :: String -> H256 #

ByteArrayAccess H256 Source # 
Instance details

Defined in Data.BigNum

Methods

length :: H256 -> Int #

withByteArray :: H256 -> (Ptr p -> IO a) -> IO a #

copyByteArrayToPtr :: H256 -> Ptr p -> IO () #

ToHex H256 Source # 
Instance details

Defined in Data.BigNum

Methods

toHex :: H256 -> HexString #

FromHex H256 Source # 
Instance details

Defined in Data.BigNum

Encode H256 Source # 
Instance details

Defined in Data.BigNum

Methods

put :: Putter H256 #

Decode H256 Source # 
Instance details

Defined in Data.BigNum

Methods

get :: Get H256 #

h256 :: ByteArrayAccess a => a -> Maybe H256 Source #

Convert any 32 byte array into H256 type, otherwise returns Nothing.

data H512 Source #

64 byte of data.

Instances

Instances details
Eq H512 Source # 
Instance details

Defined in Data.BigNum

Methods

(==) :: H512 -> H512 -> Bool #

(/=) :: H512 -> H512 -> Bool #

Ord H512 Source # 
Instance details

Defined in Data.BigNum

Methods

compare :: H512 -> H512 -> Ordering #

(<) :: H512 -> H512 -> Bool #

(<=) :: H512 -> H512 -> Bool #

(>) :: H512 -> H512 -> Bool #

(>=) :: H512 -> H512 -> Bool #

max :: H512 -> H512 -> H512 #

min :: H512 -> H512 -> H512 #

Show H512 Source # 
Instance details

Defined in Data.BigNum

Methods

showsPrec :: Int -> H512 -> ShowS #

show :: H512 -> String #

showList :: [H512] -> ShowS #

IsString H512 Source # 
Instance details

Defined in Data.BigNum

Methods

fromString :: String -> H512 #

ByteArrayAccess H512 Source # 
Instance details

Defined in Data.BigNum

Methods

length :: H512 -> Int #

withByteArray :: H512 -> (Ptr p -> IO a) -> IO a #

copyByteArrayToPtr :: H512 -> Ptr p -> IO () #

ToHex H512 Source # 
Instance details

Defined in Data.BigNum

Methods

toHex :: H512 -> HexString #

FromHex H512 Source # 
Instance details

Defined in Data.BigNum

Encode H512 Source # 
Instance details

Defined in Data.BigNum

Methods

put :: Putter H512 #

Decode H512 Source # 
Instance details

Defined in Data.BigNum

Methods

get :: Get H512 #

h512 :: ByteArrayAccess a => a -> Maybe H512 Source #

Convert any 64 byte array into H512 type, otherwise returns Nothing.

Orphan instances

Encode Word256 Source # 
Instance details

Methods

put :: Putter Word256 #

Encode Word128 Source # 
Instance details

Methods

put :: Putter Word128 #

Decode Word256 Source # 
Instance details

Methods

get :: Get Word256 #

Decode Word128 Source # 
Instance details

Methods

get :: Get Word128 #