cborg-0.2.10.0: Concise Binary Object Representation (CBOR)

Copyright | (c) Ben Gamari 2017-2018
License | BSD3-style (see LICENSE.txt)
Maintainer | duncan@community.haskell.org
Stability | experimental
Portability | non-portable (GHC extensions)
Safe Haskell | None
Language | Haskell2010

Codec.CBOR.ByteArray

Contents

- Simple byte arrays
- Conversions

Description

A ByteArray with more instances than `ByteArray`. Some day when these instances are reliably available from `primitive` we can likely replace this with `ByteArray`.

Synopsis

- newtype ByteArray = BA {
  - unBA :: ByteArray
  }
- sizeofByteArray :: ByteArray -> Int
- fromShortByteString :: ShortByteString -> ByteArray
- toShortByteString :: ByteArray -> ShortByteString
- fromByteString :: ByteString -> ByteArray
- toBuilder :: ByteArray -> Builder
- toSliced :: ByteArray -> SlicedByteArray

# Simple byte arrays

newtype ByteArray #

Constructors

BA |
Fields unBA :: ByteArray

#### Instances

Instances details

IsString ByteArray # |
Instance details Defined in Codec.CBOR.ByteArray Methods fromString :: String -> ByteArray #
IsList ByteArray # |
Instance details Defined in Codec.CBOR.ByteArray Associated Types
type Item ByteArray |
Instance details Defined in Codec.CBOR.ByteArray type Item ByteArray = Word8
Methods fromList :: [Item ByteArray] -> ByteArray # fromListN :: Int -> [Item ByteArray] -> ByteArray # toList :: ByteArray -> [Item ByteArray] #
Show ByteArray # |
Instance details Defined in Codec.CBOR.ByteArray Methods showsPrec :: Int -> ByteArray -> ShowS # show :: ByteArray -> String # showList :: [ByteArray] -> ShowS #
Eq ByteArray # |
Instance details Defined in Codec.CBOR.ByteArray Methods (==) :: ByteArray -> ByteArray -> Bool # (/=) :: ByteArray -> ByteArray -> Bool #
Ord ByteArray # |
Instance details Defined in Codec.CBOR.ByteArray Methods compare :: ByteArray -> ByteArray -> Ordering # (<) :: ByteArray -> ByteArray -> Bool # (<=) :: ByteArray -> ByteArray -> Bool # (>) :: ByteArray -> ByteArray -> Bool # (>=) :: ByteArray -> ByteArray -> Bool # max :: ByteArray -> ByteArray -> ByteArray # min :: ByteArray -> ByteArray -> ByteArray #
type Item ByteArray # |
Instance details Defined in Codec.CBOR.ByteArray type Item ByteArray = Word8

sizeofByteArray :: ByteArray -> Int #

# Conversions

fromShortByteString :: ShortByteString -> ByteArray #

toShortByteString :: ByteArray -> ShortByteString #

fromByteString :: ByteString -> ByteArray #

toBuilder :: ByteArray -> Builder #

toSliced :: ByteArray -> SlicedByteArray #