[commit: ghc] master: Rewrite Haddocks for GHC.Base.const (da0f043)

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


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

On branch  : master
Link       : http://ghc.haskell.org/trac/ghc/changeset/da0f04305d7bdc172f7a7a7b73f171b83acca87f/ghc

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

commit da0f04305d7bdc172f7a7a7b73f171b83acca87f
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


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

da0f04305d7bdc172f7a7a7b73f171b83acca87f
 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