Proposal for a generic showIntAtBase
Antonio Nikishaev
me at lelf.lu
Tue Apr 7 15:32:12 UTC 2015
> This has nothing to do with show.
>
> And it's already there
>
> h> fst (floatToDigits 26 500)
> [19,6]
Oh, wait. Scratch that. You have to (++ (mantissa digits)), and it's only
for RealFloat's.
>> Example:
>> λ> showIntAtBaseGeneric 26 id (:) 500 [] -- convert 500 to base26 and
>> provide output as a list.
>> [19,6]
But what's wrong with just :: Integral a => Int -> a -> [Int] ?
More information about the Libraries
mailing list