ghc-9.4.0.20220623: The GHC API
Safe HaskellSafe-Inferred
LanguageHaskell2010

GHC.Data.SmallArray

Description

Small-array

Synopsis

Documentation

data SmallArray a Source #

Constructors

SmallArray (SmallArray# a) 

newSmallArray Source #

Arguments

:: Int

size

-> a

initial contents

-> State# s 
-> (# State# s, SmallMutableArray s a #) 

writeSmallArray Source #

Arguments

:: SmallMutableArray s a

array

-> Int

index

-> a

new element

-> State# s 
-> State# s 

freezeSmallArray Source #

Arguments

:: SmallMutableArray s a

source

-> Int

offset

-> Int

length

-> State# s 
-> (# State# s, SmallArray a #) 

Copy and freeze a slice of a mutable array.

unsafeFreezeSmallArray :: SmallMutableArray s a -> State# s -> (# State# s, SmallArray a #) Source #

Freeze a mutable array (no copy!)

indexSmallArray Source #

Arguments

:: SmallArray a

array

-> Int

index

-> a 

Index a small-array (no bounds checking!)

listToArray :: Int -> (e -> Int) -> (e -> a) -> [e] -> SmallArray a Source #

Convert a list into an array.