Proposal for a generic showIntAtBase

Tikhon Jelvis tikhon at jelv.is
Mon Apr 6 17:21:55 UTC 2015


Decomposing numbers into arbitrary bases *already* exists as showIntAtBase.
Vikas's proposal is about generalizing this existing function to output
more than just strings and characters. Whether the existing naming scheme
makes sense is a separate issue. (The whole Numeric module is weird, from
the non-hierarchical name through function like showFFloatAlt.)

On Mon, Apr 6, 2015 at 3:35 AM, Henning Thielemann <
lemming at henning-thielemann.de> wrote:

>
> On Sun, 5 Apr 2015, Vikas Menon wrote:
>
>  Example:
>> λ>  showIntAtBaseGeneric 26 id (:) 500 [] -- convert 500 to base26 and
>> provide output as a list.
>> [19,6]
>>
>> Please let me know thoughts/concerns if any to this proposal.
>>
>
> That is, you want to decompose a number into digits of an arbitrary base?
> I would not associate that with "show". I have implemented this in some
> flavors:
>    https://hackage.haskell.org/package/numeric-prelude-0.4.2/
> docs/Algebra-IntegralDomain.html#v:decomposeVarPositional
>    decomposePositional in
>       http://code.haskell.org/~thielema/htam/src/NumberTheory.hs
> _______________________________________________
> Libraries mailing list
> Libraries at haskell.org
> http://mail.haskell.org/cgi-bin/mailman/listinfo/libraries
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.haskell.org/pipermail/libraries/attachments/20150406/8f8353c7/attachment.html>


More information about the Libraries mailing list