Proposal: Add hasBitSize to Data.Bits.Bits
johan.tibell at gmail.com
Tue Aug 14 00:41:35 CEST 2012
On Mon, Aug 13, 2012 at 3:26 PM, Henning Thielemann
<lemming at henning-thielemann.de> wrote:
> On Mon, 13 Aug 2012, Johan Tibell wrote:
>> On Mon, Aug 13, 2012 at 3:19 PM, Henning Thielemann
>> <lemming at henning-thielemann.de> wrote:
>>> If the method of 'FixedBitSize' is named 'bitSize' then only the type
>>> signature will be affected (FixedBitSize constraint instead of Bits).
>>> Although I don't know whether this is a good solution.
>> Imports will have to be modified as well if Bits keeps the name
>> 'bitSize' for its method.
>> In general these kind of breakages has been very painful in the past.
>> Most libraries need to support the last two or three released versions
>> of GHC (and thus base) so breaking changes like this are likely to
>> result in lots of #ifdefs in client code to paper over the
> That's true. How about keeping 'bitSize' as it is, maybe deprecate it in the
> future, add maybeBitSize to Bits class and add a new class FixedBitSize with
> method fixedBitSize?
This sounds more reasonably to me. I don't particularly need a
fixedBitSize method, but if people have uses for it go ahead.
More information about the Libraries