cborg-0.2.4.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

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