Viewing the types declared in GHC.Prim in local machine

Is it possible to view the types generated in the GHC.Prim module on my local machine? The commentary[1] states that it is a virtual module and a source file including dummy declarations are available in this location: ` libraries/base/GHC/Prim.hs`, however, upon downloading and building the latest GHC codebase I could not find this dummy file on my machine. Do I have to modify my Makefile somehow to generate these dummy types? For building, I have followed the instructions mentioned here[2] and set `BuildFlavour = devel2`. Thanks, Abhiroop Sarkar [1]https://ghc.haskell.org/trac/ghc/wiki/Commentary/PrimOps [2]https://ghc.haskell.org/trac/ghc/wiki/Newcomers

I don't think Prim.hs exists (anymore). Depending on how you installed GHC, you might have the Haddock doc files locally, which includes Prim. Or, you can :browse GHC.Prim in GHCi. Or, you can look at compiler/prelude/primops.txt.pp which generates the term-level definitions in Prim. Or, you can look at compiler/prelude/TysPrim.hs which "generates" the type-level definitions in Prim. I hope this helps! Richard
On Mar 19, 2018, at 11:53 AM, Abhiroop Sarkar
wrote: Is it possible to view the types generated in the GHC.Prim module on my local machine?
The commentary[1] states that it is a virtual module and a source file including dummy declarations are available in this location: `libraries/base/GHC/Prim.hs`, however, upon downloading and building the latest GHC codebase I could not find this dummy file on my machine. Do I have to modify my Makefile somehow to generate these dummy types?
For building, I have followed the instructions mentioned here[2] and set `BuildFlavour = devel2`.
Thanks, Abhiroop Sarkar
[1]https://ghc.haskell.org/trac/ghc/wiki/Commentary/PrimOps https://ghc.haskell.org/trac/ghc/wiki/Commentary/PrimOps [2]https://ghc.haskell.org/trac/ghc/wiki/Newcomers https://ghc.haskell.org/trac/ghc/wiki/Newcomers
_______________________________________________ ghc-devs mailing list ghc-devs@haskell.org http://mail.haskell.org/cgi-bin/mailman/listinfo/ghc-devs

Abhiroop Sarkar
Is it possible to view the types generated in the GHC.Prim module on my local machine?
The commentary[1] states that it is a virtual module and a source file including dummy declarations are available in this location: ` libraries/base/GHC/Prim.hs`, however, upon downloading and building the latest GHC codebase I could not find this dummy file on my machine. Do I have to modify my Makefile somehow to generate these dummy types?
Indeed GHC.Prim is no longer exposed by `base`; it's now in the `ghc-prim` library. If you have built the compiler you should find the module generated for Haddock in libraries/ghc-prim/dist-install/build/autogen/GHC/Prim.hs. I've updated the commentary to reflect this new location. You can also use the :browse GHCi command to dump the module's declarations. Cheers, - Ben
participants (3)
-
Abhiroop Sarkar
-
Ben Gamari
-
Richard Eisenberg