[GHC] #10142: Documentation for Ix is contradictory around minimal definition
#10142: Documentation for Ix is contradictory around minimal definition -------------------------------------+------------------------------------- Reporter: goldfire | Owner: ekmett Type: bug | Status: new Priority: normal | Milestone: Component: Core | Version: 7.8.4 Libraries | Operating System: Unknown/Multiple Keywords: | Type of failure: None/Unknown Architecture: | Blocked By: Unknown/Multiple | Related Tickets: Test Case: | Blocking: | Differential Revisions: | -------------------------------------+------------------------------------- The Haddock documentation for `Ix` [http://hackage.haskell.org/package/base-4.7.0.2/docs/Data-Ix.html here] says that the minimal definition requires `range`, `index`, and `inRange`. But then it says that the minimal definition requires `range` and `inRange`. It seems that Haddock is inferring a `MINIMAL` definition where none is in the code. Perhaps a `MINIMAL` should be added. -- Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/10142> GHC <http://www.haskell.org/ghc/> The Glasgow Haskell Compiler
#10142: Documentation for Ix is contradictory around minimal definition -------------------------------------+------------------------------------- Reporter: goldfire | Owner: hvr Type: bug | Status: new Priority: normal | Milestone: Component: Core Libraries | Version: 7.8.4 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: Type of failure: None/Unknown | Unknown/Multiple Blocked By: | Test Case: Related Tickets: | Blocking: | Differential Revisions: -------------------------------------+------------------------------------- Changes (by hvr): * owner: ekmett => hvr Comment: so while `range` and `inRange` have no default implementation, `index` has one that is recursive: {{{#!hs -- Must specify one of index, unsafeIndex -- 'index' is typically over-ridden in instances, with essentially -- the same code, but using indexError instead of hopelessIndexError -- Reason: we have 'Show' at the instances {-# INLINE index #-} -- See Note [Inlining index] index b i | inRange b i = unsafeIndex b i | otherwise = hopelessIndexError unsafeIndex b i = index b i }}} So the minimal pragma should specify that we minimally need {{{ range && inRange && (index || unsafeIndex) }}} I'll make a patch rightaway... -- Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/10142#comment:1> GHC <http://www.haskell.org/ghc/> The Glasgow Haskell Compiler
#10142: Documentation for Ix is contradictory around minimal definition -------------------------------------+------------------------------------- Reporter: goldfire | Owner: hvr Type: bug | Status: patch Priority: normal | Milestone: Component: Core Libraries | Version: 7.8.4 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: Type of failure: None/Unknown | Unknown/Multiple Blocked By: | Test Case: Related Tickets: | Blocking: | Differential Revisions: Phab:D709 -------------------------------------+------------------------------------- Changes (by hvr): * status: new => patch * differential: => Phab:D709 -- Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/10142#comment:2> GHC <http://www.haskell.org/ghc/> The Glasgow Haskell Compiler
#10142: Documentation for Ix is contradictory around minimal definition -------------------------------------+------------------------------------- Reporter: goldfire | Owner: hvr Type: bug | Status: patch Priority: normal | Milestone: 7.10.1 Component: Core Libraries | Version: 7.8.4 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: Type of failure: None/Unknown | Unknown/Multiple Blocked By: | Test Case: Related Tickets: | Blocking: | Differential Revisions: Phab:D709 -------------------------------------+------------------------------------- Changes (by hvr): * milestone: => 7.10.1 -- Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/10142#comment:3> GHC <http://www.haskell.org/ghc/> The Glasgow Haskell Compiler
#10142: Documentation for Ix is contradictory around minimal definition -------------------------------------+------------------------------------- Reporter: goldfire | Owner: hvr Type: bug | Status: patch Priority: normal | Milestone: 7.10.1 Component: Core Libraries | Version: 7.8.4 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: Type of failure: None/Unknown | Unknown/Multiple Blocked By: | Test Case: Related Tickets: | Blocking: | Differential Revisions: Phab:D709 -------------------------------------+------------------------------------- Comment (by Herbert Valerio Riedel <hvr@…>): In [changeset:"7a2d65a4d93273c89fbb1d19e282d5933c67c7ca/ghc"]: {{{ #!CommitTicketReference repository="ghc" revision="7a2d65a4d93273c89fbb1d19e282d5933c67c7ca" Define proper `MINIMAL` pragma for `class Ix` Summary: This addresses #10142 Reviewers: goldfire, austin, ekmett Reviewed By: austin, ekmett Subscribers: thomie Differential Revision: https://phabricator.haskell.org/D709 GHC Trac Issues: #10142 }}} -- Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/10142#comment:4> GHC <http://www.haskell.org/ghc/> The Glasgow Haskell Compiler
#10142: Documentation for Ix is contradictory around minimal definition -------------------------------------+------------------------------------- Reporter: goldfire | Owner: hvr Type: bug | Status: closed Priority: normal | Milestone: 7.10.1 Component: Core Libraries | Version: 7.8.4 Resolution: fixed | Keywords: Operating System: Unknown/Multiple | Architecture: Type of failure: None/Unknown | Unknown/Multiple Blocked By: | Test Case: Related Tickets: | Blocking: | Differential Revisions: Phab:D709 -------------------------------------+------------------------------------- Changes (by hvr): * status: patch => closed * resolution: => fixed Comment: landed to ghc-7.10 via 0d586136ce995f725bcaae064c98298d391ba178 -- Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/10142#comment:5> GHC <http://www.haskell.org/ghc/> The Glasgow Haskell Compiler
participants (1)
-
GHC