Rewrite Haddocks for GHC.Base.const
authorBen Gamari <bgamari.foss@gmail.com>
Mon, 4 Jan 2016 15:42:08 +0000 (16:42 +0100)
committerBen Gamari <ben@smart-cactus.org>
Mon, 4 Jan 2016 15:42:21 +0000 (16:42 +0100)
Test Plan: Read it

Reviewers: austin, hvr, #core_libraries_committee

Subscribers: thomie

Differential Revision: https://phabricator.haskell.org/D1720

GHC Trac Issues: #11314

libraries/base/GHC/Base.hs

index 92a1ac3..1f989c4 100644 (file)
@@ -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