diff options
author | Craig Ferguson <me@craigfe.io> | 2020-08-20 15:59:14 +0200 |
---|---|---|
committer | Marge Bot <ben+marge-bot@smart-cactus.org> | 2020-08-22 03:30:13 -0400 |
commit | 3f50154591ada9064351ccec4adfe6df53ca2439 (patch) | |
tree | c0850074bf8a2995e82cc723b58539f6879d6ecf | |
parent | 03cfcfd450335d5ecb63fec1f55d9feafabb2b4c (diff) | |
download | haskell-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.hs | 2 |
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 |