Proposal: Add hasBitSize to Data.Bits.Bits

Lennart Augustsson lennart at augustsson.net
Sun Jul 29 02:11:33 CEST 2012


Don't add hasBitSize, add perhapsBitSize (or some other name) which returns
a Maybe, and then bitSize can be deprecated.

  -- Lennart

On Sat, Jul 28, 2012 at 5:57 PM, Andreas Abel <andreas.abel at ifi.lmu.de>wrote:

> On 28.07.12 4:40 PM, John Lato wrote:
>
>> From: Edward Kmett <ekmett at gmail.com>
>>>
>>> On Fri, Jul 27, 2012 at 3:42 PM, Ian Lynagh <igloo at earth.li> wrote:
>>>
>>>  On Fri, Jul 27, 2012 at 03:06:04PM -0400, Edward Kmett wrote:
>>>>
>>>>> There is currently no way to know whether or not calling
>>>>> Data.Bits.bitSizewill crash your program.
>>>>>
>>>>> I propose extending the Bits class to include:
>>>>>
>>>>> hasBitSize :: Bits b => b -> Bool
>>>>>
>>>>
>> I'm in favor of changing the type of bitSize, although since none of
>> my code uses that function it's an easy position for me to take.
>>
>
> +1.  The Haskellish solution would let return bitSize a Maybe.
>
> --
> Andreas Abel  <><      Du bist der geliebte Mensch.
>
> Theoretical Computer Science, University of Munich
> Oettingenstr. 67, D-80538 Munich, GERMANY
>
> andreas.abel at ifi.lmu.de
> http://www2.tcs.ifi.lmu.de/~**abel/ <http://www2.tcs.ifi.lmu.de/~abel/>
>
>
>
>
> ______________________________**_________________
> Libraries mailing list
> Libraries at haskell.org
> http://www.haskell.org/**mailman/listinfo/libraries<http://www.haskell.org/mailman/listinfo/libraries>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.haskell.org/pipermail/libraries/attachments/20120729/a978e239/attachment.htm>


More information about the Libraries mailing list