const: Read-only mutable primitives

[ ffi, library ] [ Propose Tags ]

Read-only mutable primitives.

This can be used for more accurate FFI bindings or simply to indicate more cleanly in your code what you are and aren't allowed to modify.

[Skip to Readme]


Maintainer's Corner

Package maintainers

For package maintainers and hackage trustees


Versions [RSS] 0
Change log
Dependencies base (>=4.12 && <5), bytestring (>=0.10.8 && <0.12), primitive (>=0.7 && <0.8), ptrdiff (<0.1) [details]
License (BSD-2-Clause OR Apache-2.0)
Copyright Copyright (c) 2019-2021 Edward Kmett
Author Edward Kmett
Maintainer Edward Kmett <>
Category FFI
Home page
Source repo head: git clone
Uploaded by EdwardKmett at 2021-03-24T01:56:35Z
Downloads 175 total (4 in the last 30 days)
Rating (no votes yet) [estimated by Bayesian average]
Your Rating
  • λ
  • λ
  • λ
Status Docs uploaded by user
Build status unknown [no reports yet]

Readme for const-0

[back to package description]



This package provides a small shim around the data types and operations in Foreign and Data.Primitive for emulating const-correctness from a C perspective.

In the future it'd be nice to have a proper const-cast that can handle nested ConstPtr's, etc. but this suffices for my current usecases. Patches welcome!

Contact Information

Contributions and bug reports are welcome!

Please feel free to contact me through github or on the #haskell IRC channel on

-Edward Kmett