Skip to content

Data.Primitive.ByteArray.ByteArray + instances in base?

Motivation

Several libraries define a boxed wrapper for ByteArray#:

This is a suboptimal situation, causing significant duplication and (more importantly) complicating APIs of respective packages and interoperation between them.

Proposal

Export a boxed ByteArray type as defined in Data.Primitive.ByteArray + its instances from a new module in base.

There may be more ambitious proposals (e. g., export other utilities from Data.Primitive.ByteArray; export boxed MutableByteArray, etc.), but I'd like to avoid endless bikeshedding, so decided to propose the bare minimum.

CC @andrewthad

To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information