summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLeif Metcalf <me@leif.nz>2020-09-14 14:44:52 +1200
committerMarge Bot <ben+marge-bot@smart-cactus.org>2020-09-17 08:51:43 -0400
commit5c7387f6f8896a34af25f8a28a78095e22287752 (patch)
tree950c093f9fc65c3ca789f17e31af202ce4485b8c
parent147bb59826087300f989addfcf79e3956f6ed66b (diff)
downloadhaskell-5c7387f6f8896a34af25f8a28a78095e22287752.tar.gz
Make Z-encoding comment into a note
-rw-r--r--compiler/GHC/Data/FastString.hs3
-rw-r--r--compiler/GHC/Utils/Encoding.hs3
2 files changed, 4 insertions, 2 deletions
diff --git a/compiler/GHC/Data/FastString.hs b/compiler/GHC/Data/FastString.hs
index 604c8f3e25..133079d27d 100644
--- a/compiler/GHC/Data/FastString.hs
+++ b/compiler/GHC/Data/FastString.hs
@@ -196,7 +196,8 @@ data FastString = FastString {
n_chars :: {-# UNPACK #-} !Int, -- number of chars
fs_sbs :: {-# UNPACK #-} !ShortByteString,
fs_zenc :: FastZString
- -- ^ Lazily computed z-encoding of this string.
+ -- ^ Lazily computed z-encoding of this string. See Note [Z-Encoding] in
+ -- GHC.Utils.Encoding.
--
-- Since 'FastString's are globally memoized this is computed at most
-- once for any given string.
diff --git a/compiler/GHC/Utils/Encoding.hs b/compiler/GHC/Utils/Encoding.hs
index 592b0bd40e..68ebeedaf7 100644
--- a/compiler/GHC/Utils/Encoding.hs
+++ b/compiler/GHC/Utils/Encoding.hs
@@ -277,7 +277,8 @@ utf8EncodedLength str = go 0 str
| otherwise = go (n+4) cs
-- -----------------------------------------------------------------------------
--- The Z-encoding
+-- Note [Z-Encoding]
+-- ~~~~~~~~~~~~~~~~~
{-
This is the main name-encoding and decoding function. It encodes any