summaryrefslogtreecommitdiff
path: root/libraries/ghc-prim
diff options
context:
space:
mode:
authorBen Gamari <ben@smart-cactus.org>2022-07-17 10:48:25 -0400
committerMarge Bot <ben+marge-bot@smart-cactus.org>2022-07-22 08:18:41 -0400
commitf9ad80255dacc2047981031741caca4b2df45f4e (patch)
tree37c8dfa12abcbd00a7fbfb1d713fde76ee9e499a /libraries/ghc-prim
parente8ac91dbaeeb1296c4ae22506b01faf3b6579e9a (diff)
downloadhaskell-f9ad80255dacc2047981031741caca4b2df45f4e.tar.gz
Add a Note summarising GHC's UTF-8 implementations
GHC has a somewhat dizzying array of UTF-8 implementations. This note describes why this is the case.
Diffstat (limited to 'libraries/ghc-prim')
-rw-r--r--libraries/ghc-prim/GHC/CString.hs7
1 files changed, 5 insertions, 2 deletions
diff --git a/libraries/ghc-prim/GHC/CString.hs b/libraries/ghc-prim/GHC/CString.hs
index 680d3c8a39..003bd9af65 100644
--- a/libraries/ghc-prim/GHC/CString.hs
+++ b/libraries/ghc-prim/GHC/CString.hs
@@ -225,7 +225,6 @@ unpackCStringUtf8# addr
-- See Note [unpackCString# iterating over addr]
!ch = indexCharOffAddr# addr 0#
-
unpackAppendCStringUtf8# :: Addr# -> [Char] -> [Char]
{-# NOINLINE unpackAppendCStringUtf8# #-}
-- See the NOINLINE note on unpackCString#
@@ -288,9 +287,13 @@ cstringLength# = c_strlen
------------------------------
---- UTF8 decoding utilities
+--- UTF-8 decoding utilities
------------------------------
--
+-- This is one of several UTF-8 implementations provided by GHC; see Note
+-- [GHC's many UTF-8 implementations] in "GHC.Encoding.UTF8" for an
+-- overview.
+--
-- These functions make explicit the logic that was originally
-- part of unpackCStringUtf8. Since we want the same support for ascii
-- and non-ascii a variety of functions needs the same logic. Instead