Spec-Zone.ru › Haskell 9

Data.Array.Byte

Copyright (c) Roman Leshchinskiy 2009-2012
License BSD-style
Maintainer libraries@haskell.org
Portability non-portable
Safe Haskell Trustworthy
Language Haskell2010

Description

Derived from primitive package.

data ByteArray Source

Lifted wrapper for ByteArray#.

Since ByteArray# is an unlifted type and not a member of kind Type, things like [ByteArray#] or IO ByteArray# are ill-typed. To work around this inconvenience this module provides a standard lifted wrapper, inhabiting Type. Clients are expected to use ByteArray in higher-level APIs, but wrap and unwrap ByteArray internally as they please and use functions from GHC.Exts.

The memory representation of a ByteArray is:

╭─────────────┬───╮  ╭────────┬──────┬─────────╮
│ Constructor │ * ┼─►│ Header │ Size │ Payload │
╰─────────────┴───╯  ╰────────┴──────┴─────────╯

And its overhead is the following:

  • ByteArray constructor: 1 word
  • Pointer to ByteArray#: 1 word
  • ByteArray# Header: 1 word
  • ByteArray# Size: 1 word

Where a word is the unit of heap allocation, measuring 8 bytes on 64-bit systems, and 4 bytes on 32-bit systems.

Since: base-4.17.0.0

Constructors

ByteArray ByteArray#
Instances
Instances details
Monoid ByteArray Source

Since: base-4.17.0.0

Instance details

Defined in Data.Array.Byte

Methods

mempty :: ByteArray Source

mappend :: ByteArray -> ByteArray -> ByteArray Source

mconcat :: [ByteArray] -> ByteArray Source

Semigroup ByteArray Source

Since: base-4.17.0.0

Instance details

Defined in Data.Array.Byte

Methods

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

sconcat :: NonEmpty ByteArray -> ByteArray Source

stimes :: Integral b => b -> ByteArray -> ByteArray Source

Eq ByteArray Source

Since: base-4.17.0.0

Instance details

Defined in Data.Array.Byte

Methods

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

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

Ord ByteArray Source

Non-lexicographic ordering. This compares the lengths of the byte arrays first and uses a lexicographic ordering if the lengths are equal. Subject to change between major versions.

Since: base-4.17.0.0

Instance details

Defined in Data.Array.Byte

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

Data ByteArray Source

Since: base-4.17.0.0

Instance details

Defined in Data.Array.Byte

Methods

gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> ByteArray -> c ByteArray Source

gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c ByteArray Source

toConstr :: ByteArray -> Constr Source

dataTypeOf :: ByteArray -> DataType Source

dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c ByteArray) Source

dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c ByteArray) Source

gmapT :: (forall b. Data b => b -> b) -> ByteArray -> ByteArray Source

gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> ByteArray -> r Source

gmapQr :: forall r r'. (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> ByteArray -> r Source

gmapQ :: (forall d. Data d => d -> u) -> ByteArray -> [u] Source

gmapQi :: Int -> (forall d. Data d => d -> u) -> ByteArray -> u Source

gmapM :: Monad m => (forall d. Data d => d -> m d) -> ByteArray -> m ByteArray Source

gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> ByteArray -> m ByteArray Source

gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> ByteArray -> m ByteArray Source

IsList ByteArray Source

Since: base-4.17.0.0

Instance details

Defined in Data.Array.Byte

Associated Types

type Item ByteArray
Instance details

Defined in Data.Array.Byte

type Item ByteArray = Word8

Methods

fromList :: [Item ByteArray] -> ByteArray Source

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

toList :: ByteArray -> [Item ByteArray] Source

Show ByteArray Source

Since: base-4.17.0.0

Instance details

Defined in Data.Array.Byte

Methods

showsPrec :: Int -> ByteArray -> ShowS Source

show :: ByteArray -> String Source

showList :: [ByteArray] -> ShowS Source

Lift ByteArray Source
Instance details

Defined in Data.Array.Byte

Methods

lift :: Quote m => ByteArray -> m Exp Source

liftTyped :: forall (m :: Type -> Type). Quote m => ByteArray -> Code m ByteArray Source

type Item ByteArray Source
Instance details

Defined in Data.Array.Byte

type Item ByteArray = Word8

data MutableByteArray s Source

Lifted wrapper for MutableByteArray#.

Since MutableByteArray# is an unlifted type and not a member of kind Type, things like [MutableByteArray#] or IO MutableByteArray# are ill-typed. To work around this inconvenience this module provides a standard lifted wrapper, inhabiting Type. Clients are expected to use MutableByteArray in higher-level APIs, but wrap and unwrap MutableByteArray internally as they please and use functions from GHC.Exts.

Since: base-4.17.0.0

Constructors

MutableByteArray (MutableByteArray# s)
Instances
Instances details
Eq (MutableByteArray s) Source

Since: base-4.17.0.0

Instance details

Defined in Data.Array.Byte

Methods

(==) :: MutableByteArray s -> MutableByteArray s -> Bool Source

(/=) :: MutableByteArray s -> MutableByteArray s -> Bool Source

Typeable s => Data (MutableByteArray s) Source

Since: base-4.17.0.0

Instance details

Defined in Data.Array.Byte

Methods

gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> MutableByteArray s -> c (MutableByteArray s) Source

gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c (MutableByteArray s) Source

toConstr :: MutableByteArray s -> Constr Source

dataTypeOf :: MutableByteArray s -> DataType Source

dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c (MutableByteArray s)) Source

dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c (MutableByteArray s)) Source

gmapT :: (forall b. Data b => b -> b) -> MutableByteArray s -> MutableByteArray s Source

gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> MutableByteArray s -> r Source

gmapQr :: forall r r'. (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> MutableByteArray s -> r Source

gmapQ :: (forall d. Data d => d -> u) -> MutableByteArray s -> [u] Source

gmapQi :: Int -> (forall d. Data d => d -> u) -> MutableByteArray s -> u Source

gmapM :: Monad m => (forall d. Data d => d -> m d) -> MutableByteArray s -> m (MutableByteArray s) Source

gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> MutableByteArray s -> m (MutableByteArray s) Source

gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> MutableByteArray s -> m (MutableByteArray s) Source

© The University of Glasgow and others
Licensed under a BSD-style license (see top of the page).
https://downloads.haskell.org/~ghc/9.14.1/docs/libraries/base-4.22.0.0-66f8/Data-Array-Byte.html

Spec-Zone.ru

Настройки Оффлайн Что нового Помощь О нас
Spec-Zone .ru
спецификации, руководства, описания, API