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

Modulerio-0.1.22.0Haskell2010

RIO.Vector.Storable

Storable Vector. Import as:

import qualified RIO.Vector.Storable as VS

This module does not export any partial or unsafe functions. For those, see RIO.Vector.Storable.Partial and RIO.Vector.Storable.Unsafe

  • 2 types
  • 1 class
  • 109 values
  • Packagerio-0.1.22.0
  • Exports112
  • LanguageHaskell2010
  • LicenceMIT
  • SourceStorable.hs

Storable vectors

3 declarations
datadata Vector a
#
Instances13NFData1, Vector, IsList, Eq, Data, Ord, …
classclass Storable a where
#

The member functions of this class facilitate writing values of primitive types to raw memory (which may have been allocated with the above mentioned routines) and reading values from blocks of raw memory. The class, furthermore, includes support for computing the storage requirements and alignment restrictions of storable types.

Memory addresses are represented as values of type Ptr a, for some a which is an instance of class Storable. The type argument to Ptr helps provide some valuable type safety in FFI code (you can't mix pointers of different types without an explicit cast), while helping the Haskell type system figure out which marshalling method is needed for a given pointer.

All marshalling between Haskell and a foreign language ultimately boils down to translating Haskell data structures into the binary representation of a corresponding data structure of the foreign language and vice versa. To code this marshalling in Haskell, it is necessary to manipulate primitive data types stored in unstructured memory blocks. The class Storable facilitates this manipulation on all types for which it is instantiated, which are the standard basic types of Haskell, the fixed size Int types (Int8, Int16, Int32, Int64), the fixed size Word types (Word8, Word16, Word32, Word64), StablePtr, all types from Foreign.C.Types, as well as Ptr.

Instances90Storable, …
  • Storable CTimeSpecDefined in directory-1.3.8.5 · System.Directory.Internal.C_utimensat
  • Storable EventDefined in ghc-internal-9.1003.0 · GHC.Internal.Event.EPoll
  • Storable EventDefined in ghc-internal-9.1003.0 · GHC.Internal.Event.Poll
  • Storable PollFdDefined in ghc-internal-9.1003.0 · GHC.Internal.Event.Poll
  • Storable FingerprintDefined in ghc-internal-9.1003.0 · GHC.Internal.Foreign.Storable
  • Storable CBoolDefined in ghc-internal-9.1003.0 · GHC.Internal.Foreign.C.Types
  • Storable CCharDefined in ghc-internal-9.1003.0 · GHC.Internal.Foreign.C.Types
  • Storable CClockDefined in ghc-internal-9.1003.0 · GHC.Internal.Foreign.C.Types
  • Storable CDoubleDefined in ghc-internal-9.1003.0 · GHC.Internal.Foreign.C.Types
  • Storable CFloatDefined in ghc-internal-9.1003.0 · GHC.Internal.Foreign.C.Types
  • Storable CIntDefined in ghc-internal-9.1003.0 · GHC.Internal.Foreign.C.Types
  • Storable CIntMaxDefined in ghc-internal-9.1003.0 · GHC.Internal.Foreign.C.Types
  • Storable CIntPtrDefined in ghc-internal-9.1003.0 · GHC.Internal.Foreign.C.Types
  • Storable CLLongDefined in ghc-internal-9.1003.0 · GHC.Internal.Foreign.C.Types
  • Storable CLongDefined in ghc-internal-9.1003.0 · GHC.Internal.Foreign.C.Types
  • Storable CPtrdiffDefined in ghc-internal-9.1003.0 · GHC.Internal.Foreign.C.Types
  • Storable CSCharDefined in ghc-internal-9.1003.0 · GHC.Internal.Foreign.C.Types
  • Storable CSUSecondsDefined in ghc-internal-9.1003.0 · GHC.Internal.Foreign.C.Types
  • Storable CShortDefined in ghc-internal-9.1003.0 · GHC.Internal.Foreign.C.Types
  • Storable CSigAtomicDefined in ghc-internal-9.1003.0 · GHC.Internal.Foreign.C.Types
  • Storable CSizeDefined in ghc-internal-9.1003.0 · GHC.Internal.Foreign.C.Types
  • Storable CTimeDefined in ghc-internal-9.1003.0 · GHC.Internal.Foreign.C.Types
  • Storable CUCharDefined in ghc-internal-9.1003.0 · GHC.Internal.Foreign.C.Types
  • Storable CUIntDefined in ghc-internal-9.1003.0 · GHC.Internal.Foreign.C.Types
  • Storable CUIntMaxDefined in ghc-internal-9.1003.0 · GHC.Internal.Foreign.C.Types
  • Storable CUIntPtrDefined in ghc-internal-9.1003.0 · GHC.Internal.Foreign.C.Types
  • Storable CULLongDefined in ghc-internal-9.1003.0 · GHC.Internal.Foreign.C.Types
  • Storable CULongDefined in ghc-internal-9.1003.0 · GHC.Internal.Foreign.C.Types
  • Storable CUSecondsDefined in ghc-internal-9.1003.0 · GHC.Internal.Foreign.C.Types
  • Storable CUShortDefined in ghc-internal-9.1003.0 · GHC.Internal.Foreign.C.Types
  • Storable CWcharDefined in ghc-internal-9.1003.0 · GHC.Internal.Foreign.C.Types
  • Storable IntPtrDefined in ghc-internal-9.1003.0 · GHC.Internal.Foreign.Ptr
  • Storable WordPtrDefined in ghc-internal-9.1003.0 · GHC.Internal.Foreign.Ptr
  • Storable FLockDefined in ghc-internal-9.1003.0 · GHC.Internal.IO.Handle.Lock.LinuxOFD
  • Storable Int16Defined in ghc-internal-9.1003.0 · GHC.Internal.Foreign.Storable
  • Storable Int32Defined in ghc-internal-9.1003.0 · GHC.Internal.Foreign.Storable
  • Storable Int64Defined in ghc-internal-9.1003.0 · GHC.Internal.Foreign.Storable
  • Storable Int8Defined in ghc-internal-9.1003.0 · GHC.Internal.Foreign.Storable
  • Storable IoSubSystemDefined in ghc-internal-9.1003.0 · GHC.Internal.RTS.Flags
  • Storable CBlkCntDefined in ghc-internal-9.1003.0 · GHC.Internal.System.Posix.Types
  • Storable CBlkSizeDefined in ghc-internal-9.1003.0 · GHC.Internal.System.Posix.Types
  • Storable CCcDefined in ghc-internal-9.1003.0 · GHC.Internal.System.Posix.Types
  • Storable CClockIdDefined in ghc-internal-9.1003.0 · GHC.Internal.System.Posix.Types
  • Storable CDevDefined in ghc-internal-9.1003.0 · GHC.Internal.System.Posix.Types
  • Storable CFsBlkCntDefined in ghc-internal-9.1003.0 · GHC.Internal.System.Posix.Types
  • Storable CFsFilCntDefined in ghc-internal-9.1003.0 · GHC.Internal.System.Posix.Types
  • Storable CGidDefined in ghc-internal-9.1003.0 · GHC.Internal.System.Posix.Types
  • Storable CIdDefined in ghc-internal-9.1003.0 · GHC.Internal.System.Posix.Types
  • Storable CInoDefined in ghc-internal-9.1003.0 · GHC.Internal.System.Posix.Types
  • Storable CKeyDefined in ghc-internal-9.1003.0 · GHC.Internal.System.Posix.Types
  • Storable CModeDefined in ghc-internal-9.1003.0 · GHC.Internal.System.Posix.Types
  • Storable CNfdsDefined in ghc-internal-9.1003.0 · GHC.Internal.System.Posix.Types
  • Storable CNlinkDefined in ghc-internal-9.1003.0 · GHC.Internal.System.Posix.Types
  • Storable COffDefined in ghc-internal-9.1003.0 · GHC.Internal.System.Posix.Types
  • Storable CPidDefined in ghc-internal-9.1003.0 · GHC.Internal.System.Posix.Types
  • Storable CRLimDefined in ghc-internal-9.1003.0 · GHC.Internal.System.Posix.Types
  • Storable CSocklenDefined in ghc-internal-9.1003.0 · GHC.Internal.System.Posix.Types
  • Storable CSpeedDefined in ghc-internal-9.1003.0 · GHC.Internal.System.Posix.Types
  • Storable CSsizeDefined in ghc-internal-9.1003.0 · GHC.Internal.System.Posix.Types
  • Storable CTcflagDefined in ghc-internal-9.1003.0 · GHC.Internal.System.Posix.Types
  • Storable CTimerDefined in ghc-internal-9.1003.0 · GHC.Internal.System.Posix.Types
  • Storable CUidDefined in ghc-internal-9.1003.0 · GHC.Internal.System.Posix.Types
  • Storable FdDefined in ghc-internal-9.1003.0 · GHC.Internal.System.Posix.Types
  • Storable Word16Defined in ghc-internal-9.1003.0 · GHC.Internal.Foreign.Storable
  • Storable Word32Defined in ghc-internal-9.1003.0 · GHC.Internal.Foreign.Storable
  • Storable Word64Defined in ghc-internal-9.1003.0 · GHC.Internal.Foreign.Storable
  • Storable Word8Defined in ghc-internal-9.1003.0 · GHC.Internal.Foreign.Storable
  • Storable BoolDefined in ghc-internal-9.1003.0 · GHC.Internal.Foreign.Storable
  • Storable CharDefined in ghc-internal-9.1003.0 · GHC.Internal.Foreign.Storable
  • Storable DoubleDefined in ghc-internal-9.1003.0 · GHC.Internal.Foreign.Storable
  • Storable FloatDefined in ghc-internal-9.1003.0 · GHC.Internal.Foreign.Storable
  • Storable IntDefined in ghc-internal-9.1003.0 · GHC.Internal.Foreign.Storable
  • Storable WordDefined in ghc-internal-9.1003.0 · GHC.Internal.Foreign.Storable
  • Storable CTimespecDefined in time-1.12.2 · Data.Time.Clock.Internal.CTimespec
  • Storable CTimevalDefined in time-1.12.2 · Data.Time.Clock.Internal.CTimeval
  • Storable DirEntDefined in unix-2.8.7.0 · System.Posix.Directory.Common
  • Storable CAttributesDefined in unix-2.8.7.0 · System.Posix.Files.Common
  • Storable CTimeSpecDefined in unix-2.8.7.0 · System.Posix.Files.Common
  • Storable CTimeValDefined in unix-2.8.7.0 · System.Posix.Files.Common
  • Storable ()Defined in ghc-internal-9.1003.0 · GHC.Internal.Foreign.Storable
  • Storable (ConstPtr a)Defined in ghc-internal-9.1003.0 · GHC.Internal.Foreign.Storable
  • Storable (FunPtr a)Defined in ghc-internal-9.1003.0 · GHC.Internal.Foreign.Storable
  • Storable (Ptr a)Defined in ghc-internal-9.1003.0 · GHC.Internal.Foreign.Storable
  • Storable (StablePtr a)Defined in ghc-internal-9.1003.0 · GHC.Internal.Foreign.Storable
  • Storable a => Storable (Complex a)Defined in base-4.20.2.0 · Data.Complex
  • Storable a => Storable (Identity a)Defined in ghc-internal-9.1003.0 · GHC.Internal.Data.Functor.Identity
  • Storable a => Storable (Down a)Defined in ghc-internal-9.1003.0 · GHC.Internal.Data.Ord
  • Prim a => Storable (PrimStorable a)Defined in primitive-0.9.1.0 · Data.Primitive.Types
  • (Storable a, Integral a) => Storable (Ratio a)Defined in ghc-internal-9.1003.0 · GHC.Internal.Foreign.Storable
  • Storable a => Storable (Const a b)Defined in ghc-internal-9.1003.0 · GHC.Internal.Data.Functor.Const

Accessors

0 declarations

Length information

Indexing

Extracting subvectors

Construction

0 declarations

Initialisation

Monadic initialisation

Unfolding

Enumeration

Concatenation

Restricting memory usage

Modifying vectors

0 declarations

Permutations

Safe destructive update

Elementwise operations

0 declarations

Mapping

Monadic mapping

Zipping

Monadic zipping

Working with predicates

0 declarations

Filtering

Partitioning

Searching

Folding

8 declarations

Specialised folds

Monadic folds

Prefix sums (scans)

12 declarations

Conversions

0 declarations

Lists

Different vector types

Mutable vectors