static-bytes-0.1.1: A Haskell library providing types representing 8, 16, 32, 64 or 128 bytes of data.

Safe Haskell | None
Language | Haskell2010

Data.StaticBytes

Synopsis

- data Bytes8
- data Bytes16
- data Bytes32
- data Bytes64
- data Bytes128
- class DynamicBytes dbytes
- class StaticBytes sbytes
- data StaticBytesException
  - = NotEnoughBytes
  - | TooManyBytes
- toStaticExact :: (DynamicBytes dbytes, StaticBytes sbytes) => dbytes -> Either StaticBytesException sbytes
- toStaticPad :: (DynamicBytes dbytes, StaticBytes sbytes) => dbytes -> Either StaticBytesException sbytes
- toStaticTruncate :: (DynamicBytes dbytes, StaticBytes sbytes) => dbytes -> Either StaticBytesException sbytes
- toStaticPadTruncate :: (DynamicBytes dbytes, StaticBytes sbytes) => dbytes -> sbytes
- fromStatic :: (DynamicBytes dbytes, StaticBytes sbytes) => sbytes -> dbytes

# Documentation

data Bytes8 Source #

A type representing 8 bytes of data.

#### Instances

Instances details

NFData Bytes8 Source # |
Instance details Defined in Data.StaticBytes Methods rnf :: Bytes8 -> () Source #
Data Bytes8 Source # |

Instance details

Defined in Data.StaticBytes

Methods

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

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

toConstr :: Bytes8 -> Constr Source #

dataTypeOf :: Bytes8 -> DataType Source #

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

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

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

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

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

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

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

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

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

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

Generic Bytes8 Source # |

Instance details

Defined in Data.StaticBytes

Associated Types

type Rep Bytes8 |
Instance details Defined in Data.StaticBytes type Rep Bytes8 = D1 ('MetaData "Bytes8" "Data.StaticBytes" "static-bytes-0.1.1-5cysE3wAjBvCiNBzJS7KC9" 'True) (C1 ('MetaCons "Bytes8" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Word64)))

Methods

from :: Bytes8 -> Rep Bytes8 x Source #

to :: Rep Bytes8 x -> Bytes8 Source #

Show Bytes8 Source # |
Instance details Defined in Data.StaticBytes Methods showsPrec :: Int -> Bytes8 -> ShowS Source # show :: Bytes8 -> String Source # showList :: [Bytes8] -> ShowS Source #
Eq Bytes8 Source # |
Instance details Defined in Data.StaticBytes Methods (==) :: Bytes8 -> Bytes8 -> Bool Source # (/=) :: Bytes8 -> Bytes8 -> Bool Source #
Ord Bytes8 Source # |
Instance details Defined in Data.StaticBytes Methods compare :: Bytes8 -> Bytes8 -> Ordering Source # (<) :: Bytes8 -> Bytes8 -> Bool Source # (<=) :: Bytes8 -> Bytes8 -> Bool Source # (>) :: Bytes8 -> Bytes8 -> Bool Source # (>=) :: Bytes8 -> Bytes8 -> Bool Source # max :: Bytes8 -> Bytes8 -> Bytes8 Source # min :: Bytes8 -> Bytes8 -> Bytes8 Source #
Hashable Bytes8 Source # |
Instance details Defined in Data.StaticBytes Methods hashWithSalt :: Int -> Bytes8 -> Int hash :: Bytes8 -> Int
ByteArrayAccess Bytes8 Source # |
Instance details Defined in Data.StaticBytes Methods length :: Bytes8 -> Int Source # withByteArray :: Bytes8 -> (Ptr p -> IO a) -> IO a Source # copyByteArrayToPtr :: Bytes8 -> Ptr p -> IO () Source #
StaticBytes Bytes8 Source # |
Instance details Defined in Data.StaticBytes Methods lengthS :: proxy Bytes8 -> Int toWordsS :: Bytes8 -> [Word64] -> [Word64] usePeekS :: Int -> (Int -> IO Word64) -> IO Bytes8
type Rep Bytes8 Source # |
Instance details Defined in Data.StaticBytes type Rep Bytes8 = D1 ('MetaData "Bytes8" "Data.StaticBytes" "static-bytes-0.1.1-5cysE3wAjBvCiNBzJS7KC9" 'True) (C1 ('MetaCons "Bytes8" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Word64)))

data Bytes16 Source #

A type representing 16 bytes of data.

#### Instances

Instances details

NFData Bytes16 Source # |
Instance details Defined in Data.StaticBytes Methods rnf :: Bytes16 -> () Source #
Data Bytes16 Source # |

Instance details

Defined in Data.StaticBytes

Methods

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

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

toConstr :: Bytes16 -> Constr Source #

dataTypeOf :: Bytes16 -> DataType Source #

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

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

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

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

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

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

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

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

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

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

Generic Bytes16 Source # |

Instance details

Defined in Data.StaticBytes

Associated Types

type Rep Bytes16 |

Instance details

Defined in Data.StaticBytes

type Rep Bytes16 = D1 ('MetaData "Bytes16" "Data.StaticBytes" "static-bytes-0.1.1-5cysE3wAjBvCiNBzJS7KC9" 'False) (C1 ('MetaCons "Bytes16" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 Bytes8) :*: S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 Bytes8)))

Methods

from :: Bytes16 -> Rep Bytes16 x Source #

to :: Rep Bytes16 x -> Bytes16 Source #

Show Bytes16 Source # |
Instance details Defined in Data.StaticBytes Methods showsPrec :: Int -> Bytes16 -> ShowS Source # show :: Bytes16 -> String Source # showList :: [Bytes16] -> ShowS Source #
Eq Bytes16 Source # |
Instance details Defined in Data.StaticBytes Methods (==) :: Bytes16 -> Bytes16 -> Bool Source # (/=) :: Bytes16 -> Bytes16 -> Bool Source #
Ord Bytes16 Source # |
Instance details Defined in Data.StaticBytes Methods compare :: Bytes16 -> Bytes16 -> Ordering Source # (<) :: Bytes16 -> Bytes16 -> Bool Source # (<=) :: Bytes16 -> Bytes16 -> Bool Source # (>) :: Bytes16 -> Bytes16 -> Bool Source # (>=) :: Bytes16 -> Bytes16 -> Bool Source # max :: Bytes16 -> Bytes16 -> Bytes16 Source # min :: Bytes16 -> Bytes16 -> Bytes16 Source #
Hashable Bytes16 Source # |
Instance details Defined in Data.StaticBytes Methods hashWithSalt :: Int -> Bytes16 -> Int hash :: Bytes16 -> Int
ByteArrayAccess Bytes16 Source # |
Instance details Defined in Data.StaticBytes Methods length :: Bytes16 -> Int Source # withByteArray :: Bytes16 -> (Ptr p -> IO a) -> IO a Source # copyByteArrayToPtr :: Bytes16 -> Ptr p -> IO () Source #
StaticBytes Bytes16 Source # |
Instance details Defined in Data.StaticBytes Methods lengthS :: proxy Bytes16 -> Int toWordsS :: Bytes16 -> [Word64] -> [Word64] usePeekS :: Int -> (Int -> IO Word64) -> IO Bytes16
type Rep Bytes16 Source # |

Instance details

Defined in Data.StaticBytes

type Rep Bytes16 = D1 ('MetaData "Bytes16" "Data.StaticBytes" "static-bytes-0.1.1-5cysE3wAjBvCiNBzJS7KC9" 'False) (C1 ('MetaCons "Bytes16" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 Bytes8) :*: S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 Bytes8)))

data Bytes32 Source #

A type representing 32 bytes of data.

#### Instances

Instances details

NFData Bytes32 Source # |
Instance details Defined in Data.StaticBytes Methods rnf :: Bytes32 -> () Source #
Data Bytes32 Source # |

Instance details

Defined in Data.StaticBytes

Methods

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

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

toConstr :: Bytes32 -> Constr Source #

dataTypeOf :: Bytes32 -> DataType Source #

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

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

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

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

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

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

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

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

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

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

Generic Bytes32 Source # |

Instance details

Defined in Data.StaticBytes

Associated Types

type Rep Bytes32 |

Instance details

Defined in Data.StaticBytes

type Rep Bytes32 = D1 ('MetaData "Bytes32" "Data.StaticBytes" "static-bytes-0.1.1-5cysE3wAjBvCiNBzJS7KC9" 'False) (C1 ('MetaCons "Bytes32" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 Bytes16) :*: S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 Bytes16)))

Methods

from :: Bytes32 -> Rep Bytes32 x Source #

to :: Rep Bytes32 x -> Bytes32 Source #

Show Bytes32 Source # |
Instance details Defined in Data.StaticBytes Methods showsPrec :: Int -> Bytes32 -> ShowS Source # show :: Bytes32 -> String Source # showList :: [Bytes32] -> ShowS Source #
Eq Bytes32 Source # |
Instance details Defined in Data.StaticBytes Methods (==) :: Bytes32 -> Bytes32 -> Bool Source # (/=) :: Bytes32 -> Bytes32 -> Bool Source #
Ord Bytes32 Source # |
Instance details Defined in Data.StaticBytes Methods compare :: Bytes32 -> Bytes32 -> Ordering Source # (<) :: Bytes32 -> Bytes32 -> Bool Source # (<=) :: Bytes32 -> Bytes32 -> Bool Source # (>) :: Bytes32 -> Bytes32 -> Bool Source # (>=) :: Bytes32 -> Bytes32 -> Bool Source # max :: Bytes32 -> Bytes32 -> Bytes32 Source # min :: Bytes32 -> Bytes32 -> Bytes32 Source #
Hashable Bytes32 Source # |
Instance details Defined in Data.StaticBytes Methods hashWithSalt :: Int -> Bytes32 -> Int hash :: Bytes32 -> Int
ByteArrayAccess Bytes32 Source # |
Instance details Defined in Data.StaticBytes Methods length :: Bytes32 -> Int Source # withByteArray :: Bytes32 -> (Ptr p -> IO a) -> IO a Source # copyByteArrayToPtr :: Bytes32 -> Ptr p -> IO () Source #
StaticBytes Bytes32 Source # |
Instance details Defined in Data.StaticBytes Methods lengthS :: proxy Bytes32 -> Int toWordsS :: Bytes32 -> [Word64] -> [Word64] usePeekS :: Int -> (Int -> IO Word64) -> IO Bytes32
type Rep Bytes32 Source # |

Instance details

Defined in Data.StaticBytes

type Rep Bytes32 = D1 ('MetaData "Bytes32" "Data.StaticBytes" "static-bytes-0.1.1-5cysE3wAjBvCiNBzJS7KC9" 'False) (C1 ('MetaCons "Bytes32" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 Bytes16) :*: S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 Bytes16)))

data Bytes64 Source #

A type representing 64 bytes of data.

#### Instances

Instances details

NFData Bytes64 Source # |
Instance details Defined in Data.StaticBytes Methods rnf :: Bytes64 -> () Source #
Data Bytes64 Source # |

Instance details

Defined in Data.StaticBytes

Methods

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

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

toConstr :: Bytes64 -> Constr Source #

dataTypeOf :: Bytes64 -> DataType Source #

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

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

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

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

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

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

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

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

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

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

Generic Bytes64 Source # |

Instance details

Defined in Data.StaticBytes

Associated Types

type Rep Bytes64 |

Instance details

Defined in Data.StaticBytes

type Rep Bytes64 = D1 ('MetaData "Bytes64" "Data.StaticBytes" "static-bytes-0.1.1-5cysE3wAjBvCiNBzJS7KC9" 'False) (C1 ('MetaCons "Bytes64" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 Bytes32) :*: S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 Bytes32)))

Methods

from :: Bytes64 -> Rep Bytes64 x Source #

to :: Rep Bytes64 x -> Bytes64 Source #

Show Bytes64 Source # |
Instance details Defined in Data.StaticBytes Methods showsPrec :: Int -> Bytes64 -> ShowS Source # show :: Bytes64 -> String Source # showList :: [Bytes64] -> ShowS Source #
Eq Bytes64 Source # |
Instance details Defined in Data.StaticBytes Methods (==) :: Bytes64 -> Bytes64 -> Bool Source # (/=) :: Bytes64 -> Bytes64 -> Bool Source #
Ord Bytes64 Source # |
Instance details Defined in Data.StaticBytes Methods compare :: Bytes64 -> Bytes64 -> Ordering Source # (<) :: Bytes64 -> Bytes64 -> Bool Source # (<=) :: Bytes64 -> Bytes64 -> Bool Source # (>) :: Bytes64 -> Bytes64 -> Bool Source # (>=) :: Bytes64 -> Bytes64 -> Bool Source # max :: Bytes64 -> Bytes64 -> Bytes64 Source # min :: Bytes64 -> Bytes64 -> Bytes64 Source #
Hashable Bytes64 Source # |
Instance details Defined in Data.StaticBytes Methods hashWithSalt :: Int -> Bytes64 -> Int hash :: Bytes64 -> Int
ByteArrayAccess Bytes64 Source # |
Instance details Defined in Data.StaticBytes Methods length :: Bytes64 -> Int Source # withByteArray :: Bytes64 -> (Ptr p -> IO a) -> IO a Source # copyByteArrayToPtr :: Bytes64 -> Ptr p -> IO () Source #
StaticBytes Bytes64 Source # |
Instance details Defined in Data.StaticBytes Methods lengthS :: proxy Bytes64 -> Int toWordsS :: Bytes64 -> [Word64] -> [Word64] usePeekS :: Int -> (Int -> IO Word64) -> IO Bytes64
type Rep Bytes64 Source # |

Instance details

Defined in Data.StaticBytes

type Rep Bytes64 = D1 ('MetaData "Bytes64" "Data.StaticBytes" "static-bytes-0.1.1-5cysE3wAjBvCiNBzJS7KC9" 'False) (C1 ('MetaCons "Bytes64" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 Bytes32) :*: S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 Bytes32)))

data Bytes128 Source #

A type representing 128 bytes of data.

#### Instances

Instances details

NFData Bytes128 Source # |
Instance details Defined in Data.StaticBytes Methods rnf :: Bytes128 -> () Source #
Data Bytes128 Source # |

Instance details

Defined in Data.StaticBytes

Methods

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

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

toConstr :: Bytes128 -> Constr Source #

dataTypeOf :: Bytes128 -> DataType Source #

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

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

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

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

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

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

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

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

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

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

Generic Bytes128 Source # |

Instance details

Defined in Data.StaticBytes

Associated Types

type Rep Bytes128 |

Instance details

Defined in Data.StaticBytes

type Rep Bytes128 = D1 ('MetaData "Bytes128" "Data.StaticBytes" "static-bytes-0.1.1-5cysE3wAjBvCiNBzJS7KC9" 'False) (C1 ('MetaCons "Bytes128" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 Bytes64) :*: S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 Bytes64)))

Methods

from :: Bytes128 -> Rep Bytes128 x Source #

to :: Rep Bytes128 x -> Bytes128 Source #

Show Bytes128 Source # |
Instance details Defined in Data.StaticBytes Methods showsPrec :: Int -> Bytes128 -> ShowS Source # show :: Bytes128 -> String Source # showList :: [Bytes128] -> ShowS Source #
Eq Bytes128 Source # |
Instance details Defined in Data.StaticBytes Methods (==) :: Bytes128 -> Bytes128 -> Bool Source # (/=) :: Bytes128 -> Bytes128 -> Bool Source #
Ord Bytes128 Source # |
Instance details Defined in Data.StaticBytes Methods compare :: Bytes128 -> Bytes128 -> Ordering Source # (<) :: Bytes128 -> Bytes128 -> Bool Source # (<=) :: Bytes128 -> Bytes128 -> Bool Source # (>) :: Bytes128 -> Bytes128 -> Bool Source # (>=) :: Bytes128 -> Bytes128 -> Bool Source # max :: Bytes128 -> Bytes128 -> Bytes128 Source # min :: Bytes128 -> Bytes128 -> Bytes128 Source #
Hashable Bytes128 Source # |
Instance details Defined in Data.StaticBytes Methods hashWithSalt :: Int -> Bytes128 -> Int hash :: Bytes128 -> Int
ByteArrayAccess Bytes128 Source # |
Instance details Defined in Data.StaticBytes Methods length :: Bytes128 -> Int Source # withByteArray :: Bytes128 -> (Ptr p -> IO a) -> IO a Source # copyByteArrayToPtr :: Bytes128 -> Ptr p -> IO () Source #
StaticBytes Bytes128 Source # |
Instance details Defined in Data.StaticBytes Methods lengthS :: proxy Bytes128 -> Int toWordsS :: Bytes128 -> [Word64] -> [Word64] usePeekS :: Int -> (Int -> IO Word64) -> IO Bytes128
type Rep Bytes128 Source # |

Instance details

Defined in Data.StaticBytes

type Rep Bytes128 = D1 ('MetaData "Bytes128" "Data.StaticBytes" "static-bytes-0.1.1-5cysE3wAjBvCiNBzJS7KC9" 'False) (C1 ('MetaCons "Bytes128" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 Bytes64) :*: S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 Bytes64)))

class DynamicBytes dbytes Source #

Minimal complete definition

lengthD, withPeekD, fromWordsD

#### Instances

Instances details

DynamicBytes ByteString Source # |
Instance details Defined in Data.StaticBytes Methods lengthD :: ByteString -> Int withPeekD :: ByteString -> ((Int -> IO Word64) -> IO a) -> IO a fromWordsD :: Int -> [Word64] -> ByteString
word8 ~ Word8 => DynamicBytes (Vector word8) Source # |
Instance details Defined in Data.StaticBytes Methods lengthD :: Vector word8 -> Int withPeekD :: Vector word8 -> ((Int -> IO Word64) -> IO a) -> IO a fromWordsD :: Int -> [Word64] -> Vector word8
word8 ~ Word8 => DynamicBytes (Vector word8) Source # |
Instance details Defined in Data.StaticBytes Methods lengthD :: Vector word8 -> Int withPeekD :: Vector word8 -> ((Int -> IO Word64) -> IO a) -> IO a fromWordsD :: Int -> [Word64] -> Vector word8
word8 ~ Word8 => DynamicBytes (Vector word8) Source # |
Instance details Defined in Data.StaticBytes Methods lengthD :: Vector word8 -> Int withPeekD :: Vector word8 -> ((Int -> IO Word64) -> IO a) -> IO a fromWordsD :: Int -> [Word64] -> Vector word8

class StaticBytes sbytes Source #

Minimal complete definition

lengthS, toWordsS, usePeekS

#### Instances

Instances details

StaticBytes Bytes128 Source # |
Instance details Defined in Data.StaticBytes Methods lengthS :: proxy Bytes128 -> Int toWordsS :: Bytes128 -> [Word64] -> [Word64] usePeekS :: Int -> (Int -> IO Word64) -> IO Bytes128
StaticBytes Bytes16 Source # |
Instance details Defined in Data.StaticBytes Methods lengthS :: proxy Bytes16 -> Int toWordsS :: Bytes16 -> [Word64] -> [Word64] usePeekS :: Int -> (Int -> IO Word64) -> IO Bytes16
StaticBytes Bytes32 Source # |
Instance details Defined in Data.StaticBytes Methods lengthS :: proxy Bytes32 -> Int toWordsS :: Bytes32 -> [Word64] -> [Word64] usePeekS :: Int -> (Int -> IO Word64) -> IO Bytes32
StaticBytes Bytes64 Source # |
Instance details Defined in Data.StaticBytes Methods lengthS :: proxy Bytes64 -> Int toWordsS :: Bytes64 -> [Word64] -> [Word64] usePeekS :: Int -> (Int -> IO Word64) -> IO Bytes64
StaticBytes Bytes8 Source # |
Instance details Defined in Data.StaticBytes Methods lengthS :: proxy Bytes8 -> Int toWordsS :: Bytes8 -> [Word64] -> [Word64] usePeekS :: Int -> (Int -> IO Word64) -> IO Bytes8

data StaticBytesException Source #

A type representing exceptions thrown by functions expecting data of a fixed number of bytes.

Constructors

NotEnoughBytes |
TooManyBytes |

#### Instances

Instances details

Exception StaticBytesException Source # |
Instance details Defined in Data.StaticBytes Methods toException :: StaticBytesException -> SomeException Source # fromException :: SomeException -> Maybe StaticBytesException Source # displayException :: StaticBytesException -> String Source # backtraceDesired :: StaticBytesException -> Bool Source #
Show StaticBytesException Source # |
Instance details Defined in Data.StaticBytes Methods showsPrec :: Int -> StaticBytesException -> ShowS Source # show :: StaticBytesException -> String Source # showList :: [StaticBytesException] -> ShowS Source #
Eq StaticBytesException Source # |
Instance details Defined in Data.StaticBytes Methods (==) :: StaticBytesException -> StaticBytesException -> Bool Source # (/=) :: StaticBytesException -> StaticBytesException -> Bool Source #

toStaticExact :: (DynamicBytes dbytes, StaticBytes sbytes) => dbytes -> Either StaticBytesException sbytes Source #

toStaticPad :: (DynamicBytes dbytes, StaticBytes sbytes) => dbytes -> Either StaticBytesException sbytes Source #

toStaticTruncate :: (DynamicBytes dbytes, StaticBytes sbytes) => dbytes -> Either StaticBytesException sbytes Source #

toStaticPadTruncate :: (DynamicBytes dbytes, StaticBytes sbytes) => dbytes -> sbytes Source #

fromStatic :: (DynamicBytes dbytes, StaticBytes sbytes) => sbytes -> dbytes Source #