# primitive

> Primitive memory-related operations for Haskell

Source: https://talira.ai/catalog/primitive-1txb4m7z
Every listing: https://talira.ai/catalog.md

- Kind: Open source
- Types: Library
- Categories: [libraries / data structures / arrays](https://talira.ai/categories/libraries/data-structures/arrays), [languages / haskell](https://talira.ai/categories/languages/haskell)
- Licence: BSD-3-Clause[^1]
- Pricing: Free and open source[^1]
- Free tier: yes[^1]
- Backed by: [Haskell Libraries Team](https://talira.ai/orgs/haskell-libraries-team.md)

primitive is a Haskell library of low-level memory operations over GHC's primitives: boxed, small and unboxed arrays (Array, SmallArray, PrimArray), mutable and immutable byte arrays, raw pointers, mutable variables (MutVar, MVar, PrimVar) and the PrimMonad class that lets the same code run in IO or ST. Written by Roman Leshchinskiy and maintained by the Haskell Libraries Team, it supports GHC 8.2 to 9.14. BSD 3-Clause licence.

## Links

- GitHub: https://github.com/haskell/primitive

## Problems it solves

- work with unboxed arrays and raw memory in Haskell without unsafe GHC internals
- write array code once that runs in both IO and ST in Haskell
- a mutable byte buffer for fast binary parsing in Haskell

## Features

- boxed, small and unboxed primitive arrays
- mutable and immutable byte arrays
- MutVar, MVar and PrimVar mutable variables
- PrimMonad class for code that runs in IO or ST
- tested with GHC 8.2 to 9.14

## Trust

Overall: 0.36 out of 1.
Signals: maintenance 0.46, adoption 0.42, momentum 0.07, community 0.67, backing 0.30, extensibility 0.00.

- last commit 2 months ago
- 1 commits in the last 90 days
- latest release v0.9.1.0 9 months ago
- 123 GitHub stars
- 46 contributors
- backed by Haskell Libraries Team

## Alternatives

- [vector](https://talira.ai/catalog/vector-h23drzvm.md): Efficient Int-indexed arrays for Haskell, mutable and immutable, with loop fusion
- [array](https://talira.ai/catalog/array-t8mep42w.md): Mutable and immutable arrays for Haskell

## Sources

[^1]: https://github.com/haskell/primitive/blob/master/LICENSE (checked 27 Nov 2026)
