summaryrefslogtreecommitdiff
path: root/libraries/base/GHC/Unicode.hs
diff options
context:
space:
mode:
authorBen Gamari <ben@smart-cactus.org>2020-02-06 18:23:30 -0500
committerMarge Bot <ben+marge-bot@smart-cactus.org>2020-02-12 17:22:37 -0500
commitf5ffd8d9ec776db708e690c4fdbf671afa8df48f (patch)
tree7092307f960d4025da0d9cf0094bf5179fb8aea2 /libraries/base/GHC/Unicode.hs
parent059c3c9d7c84fc37c69e9f414ff736d47081e72c (diff)
downloadhaskell-f5ffd8d9ec776db708e690c4fdbf671afa8df48f.tar.gz
base: Expose GHC.Unicode.unicodeVersion
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.
Diffstat (limited to 'libraries/base/GHC/Unicode.hs')
-rw-r--r--libraries/base/GHC/Unicode.hs7
1 files changed, 7 insertions, 0 deletions
diff --git a/libraries/base/GHC/Unicode.hs b/libraries/base/GHC/Unicode.hs
index 9d11b37d0c..6fba91f0e2 100644
--- a/libraries/base/GHC/Unicode.hs
+++ b/libraries/base/GHC/Unicode.hs
@@ -19,6 +19,7 @@
-----------------------------------------------------------------------------
module GHC.Unicode (
+ unicodeVersion,
GeneralCategory (..), generalCategory,
isAscii, isLatin1, isControl,
isAsciiUpper, isAsciiLower,
@@ -36,12 +37,18 @@ import GHC.Real
import GHC.Enum ( Enum (..), Bounded (..) )
import GHC.Ix ( Ix (..) )
import GHC.Num
+import {-# SOURCE #-} Data.Version
-- Data.Char.chr already imports this and we need to define a Show instance
-- for GeneralCategory
import GHC.Show ( Show )
#include "HsBaseConfig.h"
+#include "UnicodeVersion.h"
+
+-- | Version of Unicode standard used by @base@.
+unicodeVersion :: Version
+unicodeVersion = makeVersion UNICODE_VERSION_NUMS
-- | Unicode General Categories (column 2 of the UnicodeData table) in
-- the order they are listed in the Unicode standard (the Unicode