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 Source #

Constructors

BA |

Fields

- unBA :: ByteArray

#### Instances

Instances details

IsString ByteArray Source # |
Instance details Defined in Codec.CBOR.ByteArray Methods fromString :: String -> ByteArray Source #
IsList ByteArray Source # |

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 Source #

fromListN :: Int -> [Item ByteArray] -> ByteArray Source #

toList :: ByteArray -> [Item ByteArray] Source #

Show ByteArray Source # |
Instance details Defined in Codec.CBOR.ByteArray Methods showsPrec :: Int -> ByteArray -> ShowS Source # show :: ByteArray -> String Source # showList :: [ByteArray] -> ShowS Source #
Eq ByteArray Source # |
Instance details Defined in Codec.CBOR.ByteArray Methods (==) :: ByteArray -> ByteArray -> Bool Source # (/=) :: ByteArray -> ByteArray -> Bool Source #
Ord ByteArray Source # |

Instance details

Defined in Codec.CBOR.ByteArray

Methods

compare :: ByteArray -> ByteArray -> Ordering Source #

(<) :: ByteArray -> ByteArray -> Bool Source #

(<=) :: ByteArray -> ByteArray -> Bool Source #

(>) :: ByteArray -> ByteArray -> Bool Source #

(>=) :: ByteArray -> ByteArray -> Bool Source #

max :: ByteArray -> ByteArray -> ByteArray Source #

min :: ByteArray -> ByteArray -> ByteArray Source #

type Item ByteArray Source # |
Instance details Defined in Codec.CBOR.ByteArray type Item ByteArray = Word8

sizeofByteArray :: ByteArray -> Int Source #

# Conversions

fromShortByteString :: ShortByteString -> ByteArray Source #

toShortByteString :: ByteArray -> ShortByteString Source #

fromByteString :: ByteString -> ByteArray Source #

toBuilder :: ByteArray -> Builder Source #

toSliced :: ByteArray -> SlicedByteArray Source #