summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCraig Ferguson <me@craigfe.io>2020-08-20 15:59:14 +0200
committerMarge Bot <ben+marge-bot@smart-cactus.org>2020-08-22 03:30:13 -0400
commit3f50154591ada9064351ccec4adfe6df53ca2439 (patch)
treec0850074bf8a2995e82cc723b58539f6879d6ecf
parent03cfcfd450335d5ecb63fec1f55d9feafabb2b4c (diff)
downloadhaskell-3f50154591ada9064351ccec4adfe6df53ca2439.tar.gz
Utils: clarify docs slightly
The previous comment implies `nTimes n f` is either `f^{n+1}` or `f^{2^n}` (when in fact it's `f^n`).
-rw-r--r--compiler/GHC/Utils/Misc.hs2
1 files changed, 1 insertions, 1 deletions
diff --git a/compiler/GHC/Utils/Misc.hs b/compiler/GHC/Utils/Misc.hs
index 8fba20a3c3..6597328ace 100644
--- a/compiler/GHC/Utils/Misc.hs
+++ b/compiler/GHC/Utils/Misc.hs
@@ -236,7 +236,7 @@ applyWhen :: Bool -> (a -> a) -> a -> a
applyWhen True f x = f x
applyWhen _ _ x = x
--- | A for loop: Compose a function with itself n times. (nth rather than twice)
+-- | Apply a function @n@ times to a given value.
nTimes :: Int -> (a -> a) -> (a -> a)
nTimes 0 _ = id
nTimes 1 f = f