[commit: ghc] ghc-8.0: Rewrite Haddocks for GHC.Base.const (e8b482c)

git at git.haskell.org git at git.haskell.org
Mon Jan 4 16:19:51 UTC 2016


Repository : ssh://git@git.haskell.org/ghc

On branch  : ghc-8.0
Link       : http://ghc.haskell.org/trac/ghc/changeset/e8b482c535e223fcade94550d1b0377995356116/ghc

>---------------------------------------------------------------

commit e8b482c535e223fcade94550d1b0377995356116
Author: Ben Gamari <bgamari.foss at gmail.com>
Date:   Mon Jan 4 16:42:08 2016 +0100

    Rewrite Haddocks for GHC.Base.const
    
    Test Plan: Read it
    
    Reviewers: austin, hvr, #core_libraries_committee
    
    Subscribers: thomie
    
    Differential Revision: https://phabricator.haskell.org/D1720
    
    GHC Trac Issues: #11314


>---------------------------------------------------------------

e8b482c535e223fcade94550d1b0377995356116
 libraries/base/GHC/Base.hs | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/libraries/base/GHC/Base.hs b/libraries/base/GHC/Base.hs
index 92a1ac3..1f989c4 100644
--- a/libraries/base/GHC/Base.hs
+++ b/libraries/base/GHC/Base.hs
@@ -1023,7 +1023,12 @@ breakpointCond _ r = r
 
 data Opaque = forall a. O a
 
--- | Constant function.
+-- | @const x@ is a unary function which evaluates to @x@ for all inputs.
+--
+-- For instance,
+--
+-- >>> map (const 42) [0..3]
+-- [42,42,42,42]
 const                   :: a -> b -> a
 const x _               =  x
 



More information about the ghc-commits mailing list