[Mid-discussion Summary] Proposal: add new Data.Bits.Bits(bitZero) method

Edward Kmett ekmett at gmail.com
Sat Feb 22 15:48:06 UTC 2014


I am notably strongly against taking 'zero' as it is much more
appropriately used by more algebraic classes, and it is an annoyingly
common name to take for such an often unqualified import.

-Edward


On Sat, Feb 22, 2014 at 5:03 AM, Herbert Valerio Riedel <hvr at gnu.org> wrote:

> Hello *,
>
> Here's a mid-discussion summary of the proposal
>
> >> Introduce a new class method
> >>
> >>   class Bits a where
> >>       ...
> >>       -- | Value with all bits cleared
> >>       <0-value-method> :: a
> >>       ...
> >>
> >> modulo naming of '<0-value-method>'
>
> from my point of view:
>
>  - The idea came up already in 2011 when Num-superclass was to be removed
> from Bits
>    (but discussion derailed)
>
>  - So far general consensus (i.e. no "-1"s afaics) it's desired to have
>    an all-bits-clear value introducing method in 'Bits'
>
>  - Use "clearBit (bit 0) 0" as default implementation for smooth
> upgrade-path
>
>  - Nameing for <0-value-method> boils down to two candidates:
>
>     a) 'Data.Bits.zero'
>
>         - based on the idea tha 'Data.Bits' ought to be imported
>           qualified (or with explicit import-list) anyway
>           (-> thus following PVP practice)
>
>         - many existing Data.Bits.Bits methods such as 'rotate',
>           'complement', 'popCount', 'xor', or 'shift' don't have
>           the name 'bit' in it (and those few that have, operate
>           on single bits)
>
>         - supporters (in no particular order):
>
>            - ARJANEN Loïc Jean David
>            - Henning Thielemann
>            - Herbert Valerio Riedel (+0.99)
>            - Twan van Laarhoven
>
>     b) 'Data.Bits.zeroBits'
>
>         - more verbose name reduces risk of namespace conflicts with
> unqualified imports
>
>         - supporters (in no particular order):
>
>            - Edward Kmett
>            - Eric Mertens
>            - Herbert Valerio Riedel
>            - Twan van Laarhoven
>            - (maybe?) ARJANEN Loïc Jean David
>
>
>     So far there doesn't seem to be a very clear preference for
>     'zeroBits' over 'zero'. It might help, if those how expressed some
>     kind of support for both variants could clarify if their preference
>     has any bias towards 'zeroBits' or 'zero'.
>
>
> Cheers,
>    hvr
> _______________________________________________
> Libraries mailing list
> Libraries at haskell.org
> http://www.haskell.org/mailman/listinfo/libraries
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.haskell.org/pipermail/libraries/attachments/20140222/bc51eab6/attachment.html>


More information about the Libraries mailing list