Remove bitSize from the Bits class
Changes PlannedPublic

Authored by dfeuer on Jul 10 2017, 12:22 AM.

Details

Reviewers
ekmett
hvr
bgamari
austin
Trac Issues
#12970
Summary

Remove the deprecated bitSize method from the Bits class.

dfeuer created this revision.Jul 10 2017, 12:22 AM
dfeuer updated this revision to Diff 13090.Jul 10 2017, 1:20 AM

Fix test

I think I'd prefer it if bitSize because its own top-level function:

bitSize :: FiniteBits a => a -> Int
bitSize = finiteBitSize

It does change the semantics a tad, but in a pretty benign way.

testsuite/tests/numeric/should_run/arith011.hs
181

I'm always leery about changing tests any more than is necessary. Can't we just replace bitSize with finiteBitSize here and be done with it?

dfeuer planned changes to this revision.Jul 10 2017, 3:26 PM

I think I'd prefer it if bitSize because its own top-level function:

bitSize :: FiniteBits a => a -> Int
bitSize = finiteBitSize

It does change the semantics a tad, but in a pretty benign way.

@ekmett seems to oppose stealing the name. I can ask for an official ruling from CLC.

testsuite/tests/numeric/should_run/arith011.hs
181

No, that doesn't typecheck. I think the right solution here is actually different: change this test to use bitSizeMaybe and add a new test for finiteBitSize.

austin resigned from this revision.Nov 9 2017, 5:35 PM