Proposal: Make digitToInt and intToDigit work up to base 36

Twan van Laarhoven twanvl at
Thu Jul 5 17:45:44 CEST 2012

On 29/06/12 23:12, Ian Lynagh wrote:
> Hi Twan,
> On Fri, Jun 29, 2012 at 10:59:11PM +0200, Twan van Laarhoven wrote:
>> Right now the functions only work for c <= 'f' and i <= 15, i.e. only up to
>> hexadecimal. But I can think of no reason why that should be the case.
> Have you got a real world use case for this?

Not really. It just came up on #haskell, and the arbitrary limit has bothered me
before every time I've seen it.

On 02/07/12 19:17, Bryan O'Sullivan wrote:
> This seems like a very strange change to want to make.
> It already surprised me that digitToInt accepted hex digits; having it accept
> digits in number bases that nobody uses seems like even less desirable
> behaviour.

Changing the function to only work for decimal digits would be another way to 
get rid of the wart, but that might break existing code, unfortunately.

Since people seem to be against the proposal, I'll hereby withdraw it.


More information about the Libraries mailing list