[bitc-dev] BitFields and Integral typeclass

Jonathan S. Shapiro shap at eros-os.org
Fri May 19 19:54:55 EDT 2006


On Fri, 2006-05-19 at 18:43 -0400, Swaroop Sridhar wrote:
> In order to deal with bitfields, I must write a huge number of instances.
> 
> (definstance (Integral (bitfield  int8 1)))
> (definstance (Integral (bitfield uint8 1)))
> (definstance (Integral (bitfield  int8 2)))
> (definstance (Integral (bitfield uint8 2)))
> ...
> ...
> 
> totally 508 instances
> ...
> ...
> (definstance (Integral (mutable (bitfield  int64 63))))
> (definstance (Integral (mutable (bitfield uint64 63))))
> 
> 
> This might be another case that motivates literal classes (singleton 
> types). Although -- I think -- to a lesser extent than the case of arrays.

Yes. This is why these are currently generated from a python script!

Actually, I'm not convinced that bitfields should be a member of
Integral at all.

shap




More information about the bitc-dev mailing list