HORIZON HASKELLDocslts/ghc-9.10.xc74966e2026-09-27Search names, modules, packages, or :: a typeCtrl K

GHC 9.10.3 · lts/ghc-9.10.x · c74966e · 2026-09-27

Modulecontiguous-0.6.4.2Haskell2010

Data.Primitive.Contiguous.Class

The Contiguous typeclass parameterises over a contiguous array type. It provides the core primitives necessary to implement the common API in Data.Primitive.Contiguous. This allows us to have a common API to a number of contiguous array types and their mutable counterparts.

  • 2 types
  • 3 classes
classclass Contiguous (arr :: Type -> Type) where
#

The Contiguous typeclass as an interface to a multitude of contiguous structures.

Some functions do not make sense on slices; for those, see ContiguousU.

Associated types

  • type family Mutable (arr :: Type -> Type) :: Type -> Type -> Type

    The Mutable counterpart to the array.

  • type family Element (arr :: Type -> Type) :: Type -> Constraint

    The constraint needed to store elements in the array.

  • type family Sliced (arr :: Type -> Type) :: Type -> Type

    The slice type of this array. The slice of a raw array type t should be 'Slice t', whereas the slice of a slice should be the same slice type.

  • type family MutableSliced (arr :: Type -> Type) :: Type -> Type -> Type

    The mutable slice type of this array. The mutable slice of a raw array type t should be 'MutableSlice t', whereas the mutable slice of a mutable slice should be the same slice type.

Methods

Instances5Contiguous
datadata Slice (arr :: Type -> Type) a
#

Slices of immutable arrays: packages an offset and length with a backing array.

Constructors

Instances5Contiguous, Element, Mutable, MutableSliced, Sliced
classclass Contiguous arr => ContiguousU (arr :: Type -> Type) where
#

The ContiguousU typeclass is an extension of the Contiguous typeclass, but includes operations that make sense only on unsliced contiguous structures.

Associated types

Methods

Instances4ContiguousU
classclass Always a
#

A typeclass that is satisfied by all types. This is used used to provide a fake constraint for Array and SmallArray.

Instances1Always
  • Always aDefined in contiguous-0.6.4.2 · Data.Primitive.Contiguous.Class