[GHC] #15935: TYPE is not generated by genprimops

#15935: TYPE is not generated by genprimops -------------------------------------+------------------------------------- Reporter: davide | Owner: (none) Type: bug | Status: new Priority: normal | Milestone: Component: Core | Version: 8.6.2 Libraries | Keywords: GHC.Magic | Operating System: Unknown/Multiple TYPE haddock GHC.Prim genprimops | Architecture: | Type of failure: None/Unknown Unknown/Multiple | Test Case: | Blocked By: Blocking: | Related Tickets: Differential Rev(s): | Wiki Page: -------------------------------------+------------------------------------- During validation, GHC.Magic must build without warning, and must also type check with Haddock without warnings. This causes some awkwardness in GHC.Magic (see the comment above the imports regarding genprimops) because TYPE is exported from GHC.Prim and reexported by GHC.Types. We are forced to explicitly import it via GHC.Types (and not from GHC.Prim to avoid an unused import warnings). Importing via GHC.Prim would not type check with Haddock as genprimops doesn't generate TYPE for GHC.Prim. This issue surfaced in patch D5312. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/15935 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#15935: TYPE is not generated by genprimops -------------------------------------+------------------------------------- Reporter: davide | Owner: (none) Type: bug | Status: new Priority: normal | Milestone: Component: Core Libraries | Version: 8.6.2 Resolution: | Keywords: GHC.Magic | TYPE haddock GHC.Prim genprimops Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: None/Unknown | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Comment (by harpocrates): I may be missing something, but I think that all `TYPE` needs is a `primtype` declaration somewhere in `primops.txt`: {{{ primtype TYPE r {Some Haddock documentation about TYPE} }}} The `realWorld#` issue is tougher though. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/15935#comment:1 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#15935: TYPE is not generated by genprimops -------------------------------------+------------------------------------- Reporter: davide | Owner: (none) Type: bug | Status: new Priority: normal | Milestone: Component: Core Libraries | Version: 8.6.2 Resolution: | Keywords: newcomer Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: None/Unknown | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Changes (by bgamari): * keywords: GHC.Magic TYPE haddock GHC.Prim genprimops => newcomer Comment: It's not quite that simple; `utils/genprimop` knows nothing of the `r` tyvar. You will need to introduce such a variable, along with a `primtype` for `RuntimeRep` itself. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/15935#comment:2 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#15935: TYPE is not generated by genprimops -------------------------------------+------------------------------------- Reporter: davide | Owner: (none) Type: bug | Status: new Priority: normal | Milestone: Component: Core Libraries | Version: 8.6.2 Resolution: | Keywords: newcomer Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: None/Unknown | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Comment (by harpocrates): Replying to [comment:2 bgamari]:
It's not quite that simple; `utils/genprimcode` knows nothing of the `r` tyvar. You will need to introduce such a variable, along with a `primtype` for `RuntimeRep` itself.
The `r` variable won't give `utils/genprimopcode` any problems but it won't have a kind annotation `:: RuntimeRep` on it. That's all temporary though. Once the Hi Haddock patch makes it into GHC/Haddock, you should even get the right kind annotation for free. This should all be analogous to the `data (->) a b` patch (https://phabricator.haskell.org/D5167). (With Hi Haddock, that gets rendered as `data (a :: TYPE r) -> (b :: TYPE q)`.) -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/15935#comment:3 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#15935: TYPE is not generated by genprimops -------------------------------------+------------------------------------- Reporter: davide | Owner: (none) Type: bug | Status: new Priority: normal | Milestone: Component: Core Libraries | Version: 8.6.2 Resolution: | Keywords: newcomer Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: None/Unknown | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Changes (by harpocrates): * cc: harpocrates (added) -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/15935#comment:4 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler
participants (1)
-
GHC