composewell / streamly

High performance, concurrent functional programming abstractions
https://streamly.composewell.com
Other
853 stars 63 forks source link

Use ByteArray# instead of MutableByteArray# in the immutable Array #2649

Open harendra-kumar opened 6 months ago

harendra-kumar commented 6 months ago

Freeze it before finalizing the array.

adithyaov commented 6 months ago

We use MutableByteArray# as we perform a lot of immutable ops using mutable array combinators. If we use ByteArray#, we'll have to thaw-and-freeze it at a lower level, which should be fine. Is there a reason we want to use ByteArray#?