module Data.Bits

Simon Marlow simonmar at microsoft.com
Tue Sep 10 05:13:38 EDT 2002


> The FFI Addendum actually doesn't commit to which operations
> are in the class.  It just says defines all these ops to
> have a context `Bits a', which is definitely the case.  In
> other words, you proposed implementation is valid by the
> spec and your argument for it makes sense to me.

The spec really ought to say what the member functions of the class are,
if we expect people to be able to define their own instances of Bits,
and I don't see why we shouldn't allow that.

I think Malcolm's proposed change looks reasonable, although there was
probably a reason why these functions weren't made class members in the
first place.  Alastair: it was your design originally I believe, any
thoughts?  I think it would be a small optimisation in GHC too, at least
for shifts by non-constant amounts.

Cheers,
	Simon



More information about the FFI mailing list