Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Haskell bit arrays

Tags:

arrays

haskell

How much space does an STUArray with Bool elements use for each element? Does it actually pack things down to one bit? Or does it use an entire byte per element?

like image 328
MathematicalOrchid Avatar asked Aug 07 '12 20:08

MathematicalOrchid


1 Answers

The source code of the array package shows that yes, multiple Bool are packed together as bits into byte arrays.

Doesn't seem to be documented(?)

like image 107
ephemient Avatar answered Nov 08 '22 09:11

ephemient