Confusion over bitSize, bitSizeMaybe, and finiteBitSize

chessai chessai1996 at gmail.com
Sun Jun 21 22:40:03 UTC 2020


The documentation for these functions in Data.Bits say that these
functions do not evaluate their arguments. This wording is a bit
strange to me, since it seems that does not exactly mean that any such
implementation _must not_ evaluate its argument. This may be an issue
when dealing with types whose inhabitants have finite but not
necessarily fixed sizes. For example, there is a valid Bits instance
for strict ByteString, which is finite but not fixed-size.

My question is, should the wording be changed to be a bit clearer? Or
should this restriction exist in the first place?


More information about the Libraries mailing list