summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLeif Metcalf <me@leif.nz>2020-09-14 14:44:52 +1200
committerLeif Metcalf <me@leif.nz>2020-09-15 17:27:38 -0400
commit376ba2fcbc02f4f28b6e6f59a3a8f719b2f4dc15 (patch)
tree5ad8481b15b6c39d1abcdd491a689a825c9222f6
parent4283feaa9e0826211f7a71d543054c989ea32965 (diff)
downloadhaskell-376ba2fcbc02f4f28b6e6f59a3a8f719b2f4dc15.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