| 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
- 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
A type representing 8 bytes of data.
Instances
| NFData Bytes8 Source # | |||||
Defined in Data.StaticBytes | |||||
| Data Bytes8 Source # | |||||
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 # | |||||
Defined in Data.StaticBytes Associated Types
| |||||
| Show Bytes8 Source # | |||||
| Eq Bytes8 Source # | |||||
| Ord Bytes8 Source # | |||||
| Hashable Bytes8 Source # | |||||
Defined in Data.StaticBytes | |||||
| ByteArrayAccess Bytes8 Source # | |||||
| StaticBytes Bytes8 Source # | |||||
| type Rep Bytes8 Source # | |||||
Defined in Data.StaticBytes | |||||
A type representing 16 bytes of data.
Instances
A type representing 32 bytes of data.
Instances
| NFData Bytes32 Source # | |||||
Defined in Data.StaticBytes | |||||
| Data Bytes32 Source # | |||||
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 # | |||||
Defined in Data.StaticBytes Associated Types
| |||||
| Show Bytes32 Source # | |||||
| Eq Bytes32 Source # | |||||
| Ord Bytes32 Source # | |||||
Defined in Data.StaticBytes | |||||
| Hashable Bytes32 Source # | |||||
Defined in Data.StaticBytes | |||||
| ByteArrayAccess Bytes32 Source # | |||||
| StaticBytes Bytes32 Source # | |||||
| type Rep Bytes32 Source # | |||||
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))) | |||||
A type representing 64 bytes of data.
Instances
| NFData Bytes64 Source # | |||||
Defined in Data.StaticBytes | |||||
| Data Bytes64 Source # | |||||
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 # | |||||
Defined in Data.StaticBytes Associated Types
| |||||
| Show Bytes64 Source # | |||||
| Eq Bytes64 Source # | |||||
| Ord Bytes64 Source # | |||||
Defined in Data.StaticBytes | |||||
| Hashable Bytes64 Source # | |||||
Defined in Data.StaticBytes | |||||
| ByteArrayAccess Bytes64 Source # | |||||
| StaticBytes Bytes64 Source # | |||||
| type Rep Bytes64 Source # | |||||
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))) | |||||
A type representing 128 bytes of data.
Instances
| NFData Bytes128 Source # | |||||
Defined in Data.StaticBytes | |||||
| Data Bytes128 Source # | |||||
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 # | |||||
Defined in Data.StaticBytes Associated Types
| |||||
| Show Bytes128 Source # | |||||
| Eq Bytes128 Source # | |||||
| Ord Bytes128 Source # | |||||
Defined in Data.StaticBytes | |||||
| Hashable Bytes128 Source # | |||||
Defined in Data.StaticBytes | |||||
| ByteArrayAccess Bytes128 Source # | |||||
| StaticBytes Bytes128 Source # | |||||
| type Rep Bytes128 Source # | |||||
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
| DynamicBytes ByteString Source # | |
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 # | |
| word8 ~ Word8 => DynamicBytes (Vector word8) Source # | |
| word8 ~ Word8 => DynamicBytes (Vector word8) Source # | |
class StaticBytes sbytes Source #
Minimal complete definition
lengthS, toWordsS, usePeekS
data StaticBytesException Source #
A type representing exceptions thrown by functions expecting data of a fixed number of bytes.
Constructors
| NotEnoughBytes | |
| TooManyBytes |
Instances
| Exception StaticBytesException Source # | |
Defined in Data.StaticBytes | |
| Show StaticBytesException Source # | |
Defined in Data.StaticBytes | |
| Eq StaticBytesException Source # | |
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 #