HORIZON HASKELLDocslts/ghc-10.0.x8fef28d2026-11-02Search packagesCtrl K
Theme: |

GHC 10.0.0.20260917 · lts/ghc-10.0.x · 8fef28d · 2026-11-02

Moduleprimitive-unlifted-2.2.0.0Haskell2010

Data.Primitive.Unlifted.SmallArray

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.

Contents
  1. Types
  2. Operations
  3. List Conversion
  4. Folding
  5. Traversals
  6. Mapping
Synopsis

Types

datadata SmallUnliftedArray_ (unlifted_a :: UnliftedType) a

A SmallUnliftedArray_ 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, …
datadata SmallMutableUnliftedArray_ (unlifted_a :: UnliftedType) s a
#
Instances3Eq, PrimUnlifted, Unlifted

Operations

List Conversion

Folding

Traversals

Mapping