contiguous
Unified interface for primitive arrays
https://github.com/byteverse/contiguous
| LTS Haskell 24.17: | 0.6.5.0 | 
| Stackage Nightly 2025-10-30: | 0.6.5.0 | 
| Latest on Hackage: | 0.6.5.0 | 
BSD-3-Clause licensed by Andrew Martin
Maintained by [email protected]
This version can be pinned in stack with:
contiguous-0.6.5.0@sha256:9df23f5fe1b056170032edb061bb7f047eabd6ab4c7ff69ef3e583f6b2b75418,2203Module documentation for 0.6.5.0
- Data- Data.Primitive
 
Depends on 5 packages(full list with versions):
Used by 3 packages in nightly-2025-10-30(full list with versions):
contiguous
The contiguous typeclass parameterises over a contiguous array type. This allows us to have a common API to a number of contiguous array types and their mutable counterparts, namely those in primitive, making the experience of working with the primitive datatypes much cleaner and uniform.
Changes
Revision history for contiguous
0.6.5.0 – 2025-04-07
- Implement Contiguous and ContiguousU for SmallUnliftedArray
- Re-export Small(Mutable)UnliftedArray from Data.Primitive.Contiguous
- Use functions from newer primitive and primitive-unlifted. The implementation of UnliftedArray in primitive-unlifted-2.1 penalizes the creation of an uninitialized unlifted array. When shrinking and resizing unlifted arrays, there are primitives that we can use to avoid this.
0.6.4.2 – 2024-02-06
- Restore support for versions of base that do not export liftA2from the prelude.
0.6.4.1 – 2024-02-05
- Update package metadata.
0.6.4.0 – 2023-06-28
- Make it work with primitive-unlifted-2.1, which drops support for older primitive-unlifted.
- Add quintupletonandsextupleton.
- Add construct(1|2|3|4|5|6)aliases for constructing arrays with a small known number of elements.
0.6.3.0 – 2022-12-07
- Add strict foldrM
0.6.2.0 – 2022-04-13
- Make benchmarks build
- Add strict ifoldlZipWithandfoldlZipWith
0.6.1.1 – 2022-02-16
- Allow building with GHC 9.2.1.
- Drop support for GHC 8.8 and earlier.
0.6.1.0 – 2021-09-01
- Add itraverseP
- Add deleteAtandifoldr
0.6.0 – 2021-08-28
- Add Slice,MutableSlice.
- Split ContiguousintoContiguousSliceandContiguous.
- Add shrinkandunsafeShrinkAndFreeze
0.5.2 – 2021-08-11
- Add ifoldlM'.
- Add foldrZipWithandifoldrZipWith.
- Add foldlZipWithM'andifoldlZipWithM'.
- Add allandany.
- Add run. Use it internally to accerelate prevent GHC from boxing results inrunST.
- Add quadrupleton.
0.5.1 – 2020-06-30
- Add izipWith.
- Compatibility with primitive-0.7.1.0.
0.5 – 2019-07-23
- Add generateM,reverseSlice,swap,catMaybes,zipWith,zip,lefts,rights,partitionEithers,elem,find,maximum/minimum,maximumBy/minimumBy,asum,mapM(_),forM(_),for(_),sequence(_),(<$),ap,scanl,scanl',iscanl,iscanl',prescanl,prescanl',iprescanl,iprescanl'
- Re-export Array types from the primitivepackage
- Expand unit test suite to include all added functions
- Expand laws test suite to test Foldable/IsList/Traversable laws in addition to Functor/Applicative
- Add benchmark suite that measures allocations
- Fix performance issue with fold functions that caused huge increase in allocations when partially-applied. Partially-applied folds now perform as well as fully-applied.
- Make sure all functions are marked INLINE. Last function not marked
as inline was imap'.
0.4.0.1 – 2019-05-17
- Allow building with primitive-0.7. This required depending on theprimitive-unliftedpackage to provide the removedUnliftedArrayapi.
0.4 – 2019-05-16
- Add convert,filter,ifilter,itraverse(_)(#6),imap',unsafeFromListN,unsafeFromListReverseMutableN,ifoldr',foldl,mapMutable,imapMutable,reverse,reverseMutable,replicateMutableM,create,createT,unsafeFromListReverseN,generate,generateMutable,iterate,iterateMutableN,iterateMutableNM,unfoldr,unfoldrMutable,toList,toListMutable,fromListMutableN,fromListMutable,fromListN,fromList,modify,modify',enumFromN,enumFromMutableN
- Refactor replicatefunctions to make more sense (#19)
- Add Contiguousinstance forSmallArray
- Attempt to mark everything as inline (#18)
- Achieve 100% doc coverage, organise exports a lot more (mimicking vector). Various haddock fixes
- Make toListMutablestrict in the accumulator
- Change all instances of returntopure
- Add initial test suite (some unit tests that check implementations against base/vector versions of the same functions)
- Export unsafeFreeze,copy,write,
- Rename sameMutabletoequalsMutable
0.3.3.0 – 2019-03-24
- Add freezeas a method toContiguous
- Add more folds
- Mark more functions as INLINEABLE
0.3.2.0 – 2019-01-02
- Add thawas a method toContiguous
0.3.1.0 – 2018-10-19
- Add singleton,doubleton,tripletonas methods toContiguous
- Add map',imap,mapMutable',imapMutable'
0.3.0.0 – 2018-09-06
- Document the need for Always
- Generalise API: from ST stoPrimMonad m
- Add NFData rnffunction for deeply evaluatingContiguousarrays.
- Add function equals, for detecting if two arrays in memory are the same.
- Add hashing function.
- Make mapable to produce a new array type.
- Add replicate,nullas methods toContiguous.
- Add traverse,itraverse,traverseP,foldMap
0.2.0.0 – 2018-06-07
- Add cabal metadata: category, proper synopsis/description
- Use primitive-0.6.4.0
0.1.0.0 – 2018-05-31
- Initial version.
