Proposal: add new Data.Bits.Bits(bitZero) method
Carter Schonwald
carter.schonwald at gmail.com
Sat Feb 22 14:56:39 UTC 2014
Zero is a big bit of name space. Id favor zerobits over zero.
On Saturday, February 22, 2014, 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 <javascript:;>
> http://www.haskell.org/mailman/listinfo/libraries
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.haskell.org/pipermail/libraries/attachments/20140222/b0e166c5/attachment.html>
More information about the Libraries
mailing list