This library provides types that allow the user to talk about a slice of a ByteArray or a MutableByteArray. It also offers UnmanagedBytes, which is kind of like a slice into unmanaged memory. However, it is just an address and a length.


Keywords
data, library, Propose Tags, Skip to Readme, Index, Quick Jump, Data.Bytes, Data.Bytes.Chunks, Data.Bytes.Encode.BigEndian, Data.Bytes.Encode.LittleEndian, Data.Bytes.Internal, Data.Bytes.Mutable, Data.Bytes.Text.Ascii, Data.Bytes.Text.AsciiExt, Data.Bytes.Text.Latin1, Data.Bytes.Text.Utf8, Data.Bytes.Text.Windows1252, Data.Bytes.Types, More info, byteslice-0.2.13.2.tar.gz, browse, Package description, Package maintainers, andrewthad, chessai, l3c_amartin, edit package information
License
BSD-3-Clause
Install
cabal install byteslice-0.2.13.2

Documentation

byteslice

Purpose

Types for dealing with slices of 'ByteArray' and 'MutableByteArray'. These are never supposed to introduce overhead. Rather, they exist to clarify intent in type signatures.

receive ::
     Resource -- ^ Some scarce resource
  -> MutableByteArray RealWorld -- ^ Buffer
  -> Int -- ^ Offset
  -> Int -- ^ Length
  -> IO ()

With this library, we instead write

receive ::
     Resource -- ^ Some scarce resource
  -> MutableBytes RealWorld -- ^ Buffer
  -> IO ()

The combination of the worker-wrapper transformation and inlining means that we can expect these two to end up generating the same code in most situations.