1{-# LANGUAGE BangPatterns #-}
3{-# LANGUAGE MagicHash #-}
4{-# LANGUAGE RecordWildCards #-}
5{-# LANGUAGE UnboxedTuples #-}
6{-# LANGUAGE ScopedTypeVariables #-}
11-- Module : Streamly.Memory.Array
12-- Copyright : (c) 2019 Composewell Technologies
15-- Maintainer : streamly@composewell.com
16-- Stability : experimental
19-- This module provides immutable arrays in pinned memory (non GC memory)
20-- suitable for long lived data storage, random access and for interfacing with
21-- the operating system.
23-- Arrays in this module are chunks of pinned memory that hold a sequence of
24-- 'Storable' values of a given type, they cannot store non-serializable data
25-- like functions. Once created an array cannot be modified. Pinned memory
26-- allows efficient buffering of long lived data without adding any impact to
27-- GC. One array is just one pointer visible to GC and it does not have to be
28-- copied across generations. Moreover, pinned memory allows communication
29-- with foreign consumers and producers (e.g. file or network IO) without
34-- To apply a transformation to an array use 'read' to unfold the array into a
35-- stream, apply a transformation on the stream and then use 'write' to fold it
38-- This module is designed to be imported qualified:
40-- > import qualified Streamly.Array as A
42-- For experimental APIs see "Streamly.Internal.Memory.Array".
44module Streamly.Memory.Array
50 -- | When performance matters, the fastest way to generate an array is
51 -- 'writeN'. 'IsList' and 'IsString' instances can be
52 -- used to conveniently construct arrays from literal values.
53 -- 'OverloadedLists' extension or 'fromList' can be used to construct an
54 -- array from a list literal. Similarly, 'OverloadedStrings' extension or
55 -- 'fromList' can be used to construct an array from a string literal.
62 , A.writeN -- drop new
63 , A.write -- full buffer
64 -- , writeLastN -- drop old (ring buffer)
67 -- 'GHC.Exts.toList' from "GHC.Exts" can be used to convert an array to a
80import 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