Data.Bytes.Types

byteslice-0.2.14.0: Slicing managed and unmanaged memory

Safe Haskell | None
Language | Haskell2010

Data.Bytes.Types

Synopsis

- data Bytes = Bytes {
  - array :: !ByteArray
  - offset :: !Int
  - length :: !Int
  }
- newtype Bytes# :: TYPE ('TupleRep '[UnliftedRep, 'IntRep, 'IntRep]) where
  - Bytes# :: (# ByteArray#, Int#, Int# #) -> Bytes#
- data MutableBytes s = MutableBytes {
  - array :: !(MutableByteArray s)
  - offset :: !Int
  - length :: !Int
  }
- data UnmanagedBytes = UnmanagedBytes {
  - address :: !Addr
  - length :: !Int
  }
- data BytesN (n :: Nat) = BytesN {
  - array :: !ByteArray
  - offset :: !Int
  }
- newtype ByteArrayN (n :: Nat) = ByteArrayN {
  - array :: ByteArray
  }

# Documentation

data Bytes #

A slice of a `ByteArray`.

Constructors

Bytes |
Fields array :: !ByteArray offset :: !Int length :: !Int

#### Instances

Instances details

Monoid Bytes # |
Instance details Defined in Data.Bytes.Internal Methods mempty :: Bytes # mappend :: Bytes -> Bytes -> Bytes # mconcat :: [Bytes] -> Bytes #
Semigroup Bytes # |
Instance details Defined in Data.Bytes.Internal Methods (<>) :: Bytes -> Bytes -> Bytes # sconcat :: NonEmpty Bytes -> Bytes # stimes :: Integral b => b -> Bytes -> Bytes #
IsList Bytes # |
Instance details Defined in Data.Bytes.Internal Associated Types
type Item Bytes |
Instance details Defined in Data.Bytes.Internal type Item Bytes = Word8
Methods fromList :: [Item Bytes] -> Bytes # fromListN :: Int -> [Item Bytes] -> Bytes # toList :: Bytes -> [Item Bytes] #
Show Bytes # |
Instance details Defined in Data.Bytes.Internal Methods showsPrec :: Int -> Bytes -> ShowS # show :: Bytes -> String # showList :: [Bytes] -> ShowS #
Eq Bytes # |
Instance details Defined in Data.Bytes.Internal Methods (==) :: Bytes -> Bytes -> Bool # (/=) :: Bytes -> Bytes -> Bool #
Ord Bytes # |
Instance details Defined in Data.Bytes.Internal Methods compare :: Bytes -> Bytes -> Ordering # (<) :: Bytes -> Bytes -> Bool # (<=) :: Bytes -> Bytes -> Bool # (>) :: Bytes -> Bytes -> Bool # (>=) :: Bytes -> Bytes -> Bool # max :: Bytes -> Bytes -> Bytes # min :: Bytes -> Bytes -> Bytes #
type Item Bytes # |
Instance details Defined in Data.Bytes.Internal type Item Bytes = Word8

newtype Bytes# :: TYPE ('TupleRep '[UnliftedRep, 'IntRep, 'IntRep]) where #

Constructors

Bytes# :: (# ByteArray#, Int#, Int# #) -> Bytes# |

data MutableBytes s #

A slice of a `MutableByteArray`.

Constructors

MutableBytes |
Fields array :: !(MutableByteArray s) offset :: !Int length :: !Int

data UnmanagedBytes #

A slice of unmanaged memory.

Constructors

UnmanagedBytes |
Fields address :: !Addr length :: !Int

data BytesN (n :: Nat) #

A slice of a `ByteArray` whose compile-time-known length is represented by a phantom type variable. Consumers of this data constructor must be careful to preserve the expected invariant.

Constructors

BytesN |
Fields array :: !ByteArray offset :: !Int

#### Instances

Instances details

KnownNat n => Show (BytesN n) # |
Instance details Defined in Data.Bytes.Types Methods showsPrec :: Int -> BytesN n -> ShowS # show :: BytesN n -> String # showList :: [BytesN n] -> ShowS #

newtype ByteArrayN (n :: Nat) #

A `ByteArray` whose compile-time-known length is represented by a phantom type variable. Consumers of this data constructor must be careful to preserve the expected invariant.

Constructors

ByteArrayN |
Fields array :: ByteArray

#### Instances

Instances details

KnownNat n => Show (ByteArrayN n) # |
Instance details Defined in Data.Bytes.Types Methods showsPrec :: Int -> ByteArrayN n -> ShowS # show :: ByteArrayN n -> String # showList :: [ByteArrayN n] -> ShowS #