[GHC] #16403: Add isBinDigit to Data.Char
GHC
ghc-devs at haskell.org
Thu Mar 7 12:13:16 UTC 2019
#16403: Add isBinDigit to Data.Char
-------------------------------------+-------------------------------------
Reporter: hesiod | Owner: (none)
Type: feature | Status: new
request |
Priority: normal | Milestone:
Component: | Version: 8.6.4
libraries/base |
Keywords: | Operating System: Unknown/Multiple
Architecture: | Type of failure: None/Unknown
Unknown/Multiple |
Test Case: | Blocked By:
Blocking: | Related Tickets:
Differential Rev(s): | Wiki Page:
-------------------------------------+-------------------------------------
The {{{Data.Char}}} module contains helper functions that determine
whether a Char is a decimal, octal or hexadecimal digit ({{{isDigit}}},
{{{isOctDigit}}}, {{{isHexDigit}}}). A similar helper function for binary
digits is not included for no apparent reason (maybe because the number
parsers in the {{{Numeric}}} module also don't support binary digits?).
The implementation for such a {{{isBinDigit}}} should be trivial, aside
from performance considerations: {{{isDigit}}} and friends perform the
test using only subtraction and an unsigned comparison, I'm not sure
whether {{{isBinDigit}}} offers any different performant implementations.
--
Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/16403>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler
More information about the ghc-tickets
mailing list