[Mid-discussion Summary] Proposal: add new Data.Bits.Bits(bitZero) method
Twan van Laarhoven
twanvl at gmail.com
Mon Feb 24 17:34:24 UTC 2014
I agree with Edward that it would be better to reserve 'zero' for something like
an additive identity.
I'll withdraw my +1 for the name `zero`, in favor of +1 for `zeroBits`.
Twan
On 22/02/14 16:48, Edward Kmett wrote:
> 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
> <mailto: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 <mailto:Libraries at haskell.org>
> http://www.haskell.org/mailman/listinfo/libraries
>
>
>
>
> _______________________________________________
> Libraries mailing list
> Libraries at haskell.org
> http://www.haskell.org/mailman/listinfo/libraries
>
More information about the Libraries
mailing list