[Git][ghc/ghc][master] Utils: clarify docs slightly

Marge Bot gitlab at gitlab.haskell.org
Sat Aug 22 07:30:18 UTC 2020



 Marge Bot pushed to branch master at Glasgow Haskell Compiler / GHC


Commits:
3f501545 by Craig Ferguson at 2020-08-22T03:30:13-04:00
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`).

- - - - -


1 changed file:

- compiler/GHC/Utils/Misc.hs


Changes:

=====================================
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



View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/3f50154591ada9064351ccec4adfe6df53ca2439

-- 
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/3f50154591ada9064351ccec4adfe6df53ca2439
You're receiving this email because of your account on gitlab.haskell.org.


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.haskell.org/pipermail/ghc-commits/attachments/20200822/6e65c500/attachment.html>


More information about the ghc-commits mailing list