[GHC] #11314: Documentation on const function is wrong
#11314: Documentation on const function is wrong -------------------------------------+------------------------------------- Reporter: milleniumbug | Owner: Type: bug | Status: new Priority: low | Milestone: Component: | Version: 7.10.3 libraries/base | Keywords: | Operating System: Unknown/Multiple Architecture: | Type of failure: None/Unknown Unknown/Multiple | Test Case: | Blocked By: Blocking: | Related Tickets: Differential Rev(s): | Wiki Page: -------------------------------------+------------------------------------- It currently only says Constant function which is not only not informative (how am I supposed to use this function, some API examples would be nice), but actually wrong (`const` is not a constant function, `const x` is) I suggest the following wording instead: Returns a unary constant function (a function that returns the same value for all inputs) from the argument @a@. -- Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/11314> GHC <http://www.haskell.org/ghc/> The Glasgow Haskell Compiler
#11314: Documentation on const function is wrong -------------------------------------+------------------------------------- Reporter: milleniumbug | Owner: Type: bug | Status: patch Priority: low | Milestone: 8.0.1 Component: libraries/base | Version: 7.10.3 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: Type of failure: Documentation | Unknown/Multiple bug | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Phab:D1720 Wiki Page: | -------------------------------------+------------------------------------- Changes (by bgamari): * status: new => patch * failure: None/Unknown => Documentation bug * differential: => Phab:D1720 * milestone: => 8.0.1 Old description:
It currently only says
Constant function
which is not only not informative (how am I supposed to use this function, some API examples would be nice), but actually wrong (`const` is not a constant function, `const x` is)
I suggest the following wording instead:
Returns a unary constant function (a function that returns the same value for all inputs) from the argument @a@.
New description: It currently only says
Constant function
which is not only not informative (how am I supposed to use this function, some API examples would be nice), but actually wrong (`const` is not a constant function, `const x` is) I suggest the following wording instead:
Returns a unary constant function (a function that returns the same value for all inputs) from the argument @a@.
-- Comment: Indeed, this is one of many examples where our documentation is sorely lacking. How does Phab:D1720 look? -- Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/11314#comment:1> GHC <http://www.haskell.org/ghc/> The Glasgow Haskell Compiler
#11314: Documentation on const function is wrong -------------------------------------+------------------------------------- Reporter: milleniumbug | Owner: Type: bug | Status: patch Priority: low | Milestone: 8.0.1 Component: libraries/base | Version: 7.10.3 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: Type of failure: Documentation | Unknown/Multiple bug | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Phab:D1720 Wiki Page: | -------------------------------------+------------------------------------- Comment (by Ben Gamari <ben@…>): In [changeset:"da0f04305d7bdc172f7a7a7b73f171b83acca87f/ghc" da0f043/ghc]: {{{ #!CommitTicketReference repository="ghc" revision="da0f04305d7bdc172f7a7a7b73f171b83acca87f" 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 }}} -- Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/11314#comment:2> GHC <http://www.haskell.org/ghc/> The Glasgow Haskell Compiler
#11314: Documentation on const function is wrong -------------------------------------+------------------------------------- Reporter: milleniumbug | Owner: Type: bug | Status: closed Priority: low | Milestone: 8.0.1 Component: libraries/base | Version: 7.10.3 Resolution: fixed | Keywords: Operating System: Unknown/Multiple | Architecture: Type of failure: Documentation | Unknown/Multiple bug | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Phab:D1720 Wiki Page: | -------------------------------------+------------------------------------- Changes (by bgamari): * status: patch => closed * resolution: => fixed -- Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/11314#comment:3> GHC <http://www.haskell.org/ghc/> The Glasgow Haskell Compiler
participants (1)
-
GHC