{-# language BangPatterns #-}
{-# language DataKinds #-}
{-# language MagicHash #-}
{-# language TypeFamilies #-}
{-# language DuplicateRecordFields #-}
module Data.Bytes.Types
( Bytes(..)
, Bytes#(..)
, MutableBytes(..)
, UnmanagedBytes(..)
, BytesN(..)
, ByteArrayN(..)
) where
import Data.Bytes.Internal (Bytes(..))
import Data.Primitive (ByteArray(..),MutableByteArray(..))
import Data.Primitive.Addr (Addr)
import GHC.TypeNats (Nat)
import Reps (Bytes#(..))
data BytesN (n :: Nat) = BytesN
{ BytesN n -> ByteArray
array :: {-# UNPACK #-} !ByteArray
, BytesN n -> Int
offset :: {-# UNPACK #-} !Int
}
newtype ByteArrayN (n :: Nat) = ByteArrayN
{ ByteArrayN n -> ByteArray
array :: ByteArray
}
data MutableBytes s = MutableBytes
{ MutableBytes s -> MutableByteArray s
array :: {-# UNPACK #-} !(MutableByteArray s)
, MutableBytes s -> Int
offset :: {-# UNPACK #-} !Int
, MutableBytes s -> Int
length :: {-# UNPACK #-} !Int
}
data UnmanagedBytes = UnmanagedBytes
{ UnmanagedBytes -> Addr
address :: {-# UNPACK #-} !Addr
, UnmanagedBytes -> Int
length :: {-# UNPACK #-} !Int
}