HORIZON HASKELLDocslts/ghc-9.10.x248f8f02026-10-05Search names, modules, packages, or :: a typeCtrl K

GHC 9.10.3 · lts/ghc-9.10.x · 248f8f0 · 2026-10-05

Moduleprimitive-unlifted-2.1.0.0Haskell2010

Data.Primitive.Unlifted.Array

GHC contains three general classes of value types:

  1. Unboxed types: values are machine values made up of fixed numbers of bytes. These include types like Int#, Char# and Addr#.

  2. Unlifted types: values are pointers, but strictly evaluated. These include types like MutVar# s a, Array# a, and MVar# s a.

  3. Lifted types: values are pointers, lazily evaluated.

Certain lifted types are really just thin wrappers around unboxed types (we can call these category 3a) or unlifted pointer types (we can call these category 3b) Category 3a includes Int, Char, and `Ptr a`, while category 3b includes IORef a, Data.Primitive.Array.Array a, and MVar a.

Types in category 3a can be stored efficiently in a Data.Primitive.PrimArray.PrimArray, removing and applying wrappers as required. This module provides the same facility for types in category 3b.

  • 4 types
  • 32 values

Types

4 declarations
datadata UnliftedArray_ (unlifted_a :: UnliftedType) a
#

An UnliftedArray_ a unlifted_a represents an array of values of a lifted type a that wrap values of an unlifted type unlifted_a. It is expected that unlifted_a ~ Unlifted a, but imposing that constraint here would force the type roles to nominal, which is often undesirable when arrays are used as components of larger datatypes.

Constructors

Instances8IsList, Eq, Show, Semigroup, Monoid, PrimUnlifted, …
typetype UnliftedArray a = UnliftedArray_ (Unlifted a) a
#

A type synonym for an UnliftedArray_ containing lifted values of a particular type. As a general rule, this type synonym should not be used in class instances—use UnliftedArray_ with an equality constraint instead. It also should not be used when defining newtypes or datatypes, unless those will have restrictive type roles regardless—use UnliftedArray_ instead.

datadata MutableUnliftedArray_ (unlifted_a :: UnliftedType) s a
#

A mutable version of UnliftedArray_.

Constructors

Instances3Eq, PrimUnlifted, Unlifted

Operations

21 declarations

List Conversion

3 declarations

Folding

5 declarations

Traversals

2 declarations

Mapping

1 declaration