2{-# LANGUAGE ScopedTypeVariables #-}
7-- Module : Streamly.Memory.Array
8-- Copyright : (c) 2019 Composewell Technologies
11-- Maintainer : streamly@composewell.com
12-- Stability : experimental
15-- This module provides immutable arrays in pinned memory (non GC memory)
16-- suitable for long lived data storage, random access and for interfacing with
17-- the operating system.
19-- Arrays in this module are chunks of pinned memory that hold a sequence of
20-- 'Storable' values of a given type, they cannot store non-serializable data
21-- like functions. Once created an array cannot be modified. Pinned memory
22-- allows efficient buffering of long lived data without adding any impact to
23-- GC. One array is just one pointer visible to GC and it does not have to be
24-- copied across generations. Moreover, pinned memory allows communication
25-- with foreign consumers and producers (e.g. file or network IO) without
30-- To apply a transformation to an array use 'read' to unfold the array into a
31-- stream, apply a transformation on the stream and then use 'write' to fold it
34-- This module is designed to be imported qualified:
36-- > import qualified Streamly.Array as A
38-- For experimental APIs see "Streamly.Internal.Memory.Array".
40module Streamly.Memory.Array
46 -- | When performance matters, the fastest way to generate an array is
47 -- 'writeN'. 'IsList' and 'IsString' instances can be
48 -- used to conveniently construct arrays from literal values.
49 -- 'OverloadedLists' extension or 'fromList' can be used to construct an
50 -- array from a list literal. Similarly, 'OverloadedStrings' extension or
51 -- 'fromList' can be used to construct an array from a string literal.
58 , A.writeN -- drop new
59 , A.write -- full buffer
60 -- , writeLastN -- drop old (ring buffer)
63 -- 'GHC.Exts.toList' from "GHC.Exts" can be used to convert an array to a
76import Streamly.Internal.Memory.Array as A
keysesc to close
- j k
- move down, up
- enter
- open
- esc
- back, or up a level
- 1 2 3 4
- readme, files, commits, refs
- /
- filter
- y
- copy the clone command
- c
- compare the chosen commit with another (or shift-click both)
- ?
- show or hide this list