summaryrefslogtreecommitdiff
path: root/libraries/base/GHC/Unicode.hs
Commit message (Collapse)AuthorAgeFilesLines
* Add standard Unicode case predicates isUpperCase and isLowerCase.Pierre Le Marre2022-10-141-2/+53
| | | | | | | | These predicates use the standard Unicode case properties and are more intuitive than isUpper and isLower. Approved by CLC in https://github.com/haskell/core-libraries-committee/issues/90#issuecomment-1276649403. Fixes #14589
* Pure Haskell implementation of GHC.UnicodePierre Le Marre2022-06-011-63/+58
| | | | | | | | | | | | | | | | | | | | | | | | Switch to a pure Haskell implementation of base:GHC.Unicode, based on the implementation of the package unicode-data (https://github.com/composewell/unicode-data/). Approved by CLC as per https://github.com/haskell/core-libraries-committee/issues/59#issuecomment-1132106691. - Remove current Unicode cbits. - Add generator for Unicode property files from Unicode Character Database. - Generate internal modules. - Update GHC.Unicode. - Add unicode003 test for general categories and case mappings. - Add Python scripts to check 'base' Unicode tests outputs and characters properties. Fixes #21375 ------------------------- Metric Decrease: T16875 Metric Increase: T4029 T18304 haddock.base -------------------------
* Correct doctestsOleg Grenrus2021-01-021-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | It's simpler to assume that base is NoImplicitPrelude, otherwise running doctest on `GHC.*` modules would be tricky. OTOH, most `GHC.List` (where the most name clashes are) examples could be changed to use `import qualified Data.List as L`. (GHC.List examples won't show for Foldable methods...). With these changes majority of doctest examples are GHCi-"faithful", my WIP GHC-independent doctest runner reports nice summary: Examples: 582; Tried: 546; Skipped: 34; Success: 515; Errors: 33; Property Failures 2 Most error cases are *Hangs forever*. I have yet to figure out how to demonstrate that in GHCi. Some of divergences are actually stack overflows, i.e. caught by runtime. Few errorful cases are examples of infinite output, e.g. >>> cycle [42] [42,42,42,42,42,42,42,42,42,42... while correct, they confuse doctest. Another erroneous cases are where expected output has line comment, like >>> fmap show (Just 1) -- (a -> b) -> f a -> f b Just "1" -- (Int -> String) -> Maybe Int -> Maybe String I think I just have to teach doctest to strip comments from expected output. This is a first patch in a series. There is plenty of stuff already.
* Remove all the unnecessary LANGUAGE pragmasHécate2020-08-051-1/+3
|
* base: Expose GHC.Unicode.unicodeVersionBen Gamari2020-02-121-0/+7
| | | | | | | | | | | | | This exposes a Data.Version.Version representing the version of the Unicode database used by `base`. This should clear up some confusion I have seen in tickets regarding with which Unicode versions a given GHC can be expected to work. While in town I also regenerated (but did not update) the Unicode database with database 12.0.0. Strangely, the file cited in the README no longer existed. Consequently, I used https://www.unicode.org/Public/12.0.0/ucd/UnicodeData.txt and was slightly surprised to find that there were a few changes.
* base: Move Ix typeclass to GHC.IxBen Gamari2019-09-251-1/+1
| | | | | The `Ix` class seems rather orthogonal to its original home in `GHC.Arr`.
* Remove OPTIONS_HADDOCK hide in favour for not-homeAdam Sandberg Eriksson2019-01-061-1/+1
| | | | GHC Trac Issues: #15447
* Fix ambiguous/out-of-scope Haddock identifiersAlec Theriault2018-08-211-1/+1
| | | | | | | | | | | | | | | | | This drastically cuts down on the number of Haddock warnings when making docs for `base`. Plus this means more actual links end up in the docs! Also fixed other small mostly markup issues in the documentation along the way. This is a docs-only change. Reviewers: hvr, bgamari, thomie Reviewed By: thomie Subscribers: thomie, rwbarton, carter Differential Revision: https://phabricator.haskell.org/D5055
* Fixes isAlphaNum re. isAlpha/isNumber and doc fix (trac issue #10412)ARJANEN Loïc Jean David2018-04-191-4/+5
| | | | | | | | | | | | | | | | | | | | | | | | | Corrects the inconsistency between Data.Char.isAlphaNum, Data.Char.isAlpha and Data.Char.isNumber. Indeed, isAlphaNum was returning True not only when isAlpha or isNumber returned True but also when isMark did. The selectors for the Mn, Mc and Me general categories where removed from the macro generating u_iswalnum in ubconfc. Also, Data.Char.isAlphaNum's documentation was changed to state that isAlphaNum returns true not only for Unicode number digits but for Unicode numbers in general in Unicode.hs. Signed-off-by: ARJANEN Loïc Jean David <arjanen.loic@gmail.com> Reviewers: hvr, ekmett, lelf, bgamari Reviewed By: bgamari Subscribers: thomie, carter GHC Trac Issues: #10412 Differential Revision: https://phabricator.haskell.org/D4593
* Add @since annotations for derived instances in baseChaitanya Koparkar2018-03-021-3/+8
| | | | | | | | | | | | | | Test Plan: ./validate Reviewers: hvr, goldfire, bgamari, RyanGlScott Reviewed By: RyanGlScott Subscribers: rwbarton, thomie, carter GHC Trac Issues: #11767 Differential Revision: https://phabricator.haskell.org/D4452
* Move GeneralCategory et al to GHC.UnicodeBen Gamari2015-09-081-1/+214
| | | | | | | | | | This allows these to be used from Text.Read.Lex import cycles. Reviewed By: thomie, austin Differential Revision: https://phabricator.haskell.org/D1121 GHC Trac Issues: #10444
* Improve isDigit, isSpace, etc.David Feuer2014-10-211-15/+22
| | | | | | | | | | | | | | | | Summary: Make things less branchy; use unsigned comparisons for range checking. Eliminate non-spaces more quickly in common cases in isSpace. Reviewers: ekmett, carter, austin Reviewed By: austin Subscribers: thomie, carter, ezyang, simonmar Differential Revision: https://phabricator.haskell.org/D340 GHC Trac Issues: #1473
* Refactor to avoid need for `Unicode.hs-boot`Herbert Valerio Riedel2014-10-111-25/+23
| | | | | | | | | | | This avoids the import-cycle caused by the import of `Foreign.C.Types` by using `Int` instead of `CInt` for the Unicode classification functions. This refactoring also allows to remove a couple of `fromIntegral`s. Reviewed By: rwbarton, ekmett Differential Revision: https://phabricator.haskell.org/D328
* Drop redundant `{-# LANGUAGE #-}` pragmasHerbert Valerio Riedel2013-09-281-1/+1
| | | | | | | | | | | | | This removes language pragmas from Haskell modules which are implicitly active with `default-language: Haskell2010`. Specifically, the following language extension pragmas are removed by this commit: - PatternGuards - ForeignFunctionInterface - EmptyDataDecls - NoBangPatterns Signed-off-by: Herbert Valerio Riedel <hvr@gnu.org>
* Remove obsolete pre-Haddock-2 `#hide` pragmasHerbert Valerio Riedel2013-09-231-1/+0
| | | | | | | | | | | | The now obsolete (and redundant) `#hide` pragmas have been superseded by `{-# OPTIONS_HADDOCK hide #-}` pragmas which are used by most of the affected modules anyway. This commit also adds proper `{-# OPTIONS_HADDOCK hide #-}` pragmas to `GHC.Desugar` and `GHC.IO.Encoding.Iconv` which had only the ineffective `#hide` annotation. Signed-off-by: Herbert Valerio Riedel <hvr@gnu.org>
* remove deprecated pragmas (eliminating warnings)Gabor Greif2012-10-231-1/+0
|
* Remove some commented out codeIan Lynagh2012-05-211-45/+1
| | | | Commented out since 2005, so doesn't seem worth maintaining it
* Move chr's definition into a new GHC.CharIan Lynagh2012-02-281-0/+1
| | | | This eliminates a SOURCE import
* Export constructors for Foreign.C.Types and System.Posix.Types newtypesIan Lynagh2011-10-211-1/+1
| | | | | Part of trac #5529. We also now import the constructors in various modules that use them in FFI decls.
* SafeHaskell: Added SafeHaskell to baseDavid Terei2011-06-181-8/+9
|
* Use explicit language extensions & remove extension fields from base.cabalsimonpj@microsoft.com2011-01-281-1/+2
| | | | | | | | | | Add explicit {-# LANGUAGE xxx #-} pragmas to each module, that say what extensions that module uses. This makes it clearer where different extensions are used in the (large, variagated) base package. Now base.cabal doesn't need any extensions field Thanks to Bas van Dijk for doing all the work.
* Remove redundant imports, now that NoImplicitPrelude does not imply ↵simonpj@microsoft.com2010-10-221-1/+0
| | | | RebindableSyntax
* Fix haddock formattingIan Lynagh2010-06-251-1/+1
|
* fix docs for isSpaceSimon Marlow2010-06-241-2/+2
|
* Use the proper CInt type in GHC.UnicodeIan Lynagh2008-08-061-5/+3
|
* Fix warningsIan Lynagh2008-08-051-3/+0
|
* Remove unused importsIan Lynagh2008-08-011-1/+0
|
* Avoid using deprecated flagsIan Lynagh2008-06-161-1/+1
|
* untabifyDon Stewart2008-03-051-22/+22
|
* haddock attributes for haddock-2.0Ross Paterson2008-01-201-0/+1
|
* Fix the type of wgencatIan Lynagh2007-03-291-1/+1
|
* [project @ 2005-03-16 13:27:03 by ross]ross2005-03-161-14/+22
| | | | Data.Char docs, and hide GHC.Unicode
* [project @ 2005-03-15 17:18:24 by ross]ross2005-03-151-1/+0
| | | | remove unused WInt type
* [project @ 2005-03-14 18:02:48 by ross]ross2005-03-141-106/+2
| | | | move general categories and derived predicates to Data.Char
* [project @ 2005-03-14 15:22:51 by simonmar]simonmar2005-03-141-2/+7
| | | | | - isDigit only returns True for ASCII digits - Export the new predicates from Data.Char
* [project @ 2005-03-14 12:18:05 by simonmar]simonmar2005-03-141-45/+142
| | | | | | | Add Dimitry Golubovsky <dimitry@golubovsky.org>'s Unicode character class implementation. This will remove the dependency on libc's locale code and give us much more consistent support for Unicode across platforms.
* [project @ 2005-02-03 10:32:11 by ross]ross2005-02-031-0/+1
| | | | hide GHC internals from Haddock
* [project @ 2005-01-28 15:03:06 by simonmar]simonmar2005-01-281-1/+0
| | | | Remove some unnecessary #includes of ghcconfig.h
* [project @ 2005-01-28 13:36:25 by simonmar]simonmar2005-01-281-1/+1
| | | | | | | Catch up with updates to platform #defines. Generally: use _HOST_ rather than _TARGET_ (except in Cabal where we have to retain compatibility with previous GHC versions).
* [project @ 2005-01-11 16:04:08 by simonmar]simonmar2005-01-111-1/+1
| | | | Use OPTIONS_GHC instead of OPTIONS
* [project @ 2004-11-12 17:07:54 by simonpj]simonpj2004-11-121-0/+1
| | | | Missing #include following per-package config changes
* [project @ 2004-11-12 15:14:17 by simonmar]simonmar2004-11-121-0/+9
| | | | Note Haskell 98 divergence in isAlpha.
* [project @ 2004-08-13 13:29:00 by simonmar]simonmar2004-08-131-1/+1
| | | | | Changes required be merge of backend-hacking-branch. Mostly config.h ==> ghcconfig.h.
* [project @ 2003-10-20 20:00:25 by panne]panne2003-10-201-1/+1
| | | | | Again: Fixed previous commit. Our QA department must really be on an extended vacation... :-]
* [project @ 2003-10-20 15:56:52 by simonmar]simonmar2003-10-201-0/+213
Convert Unicode.hsc to a plain .hs file to fix bootstrapping problems.