Viewing the types declared in GHC.Prim in local machine

Ben Gamari ben at smart-cactus.org
Mon Mar 19 17:04:59 UTC 2018


Abhiroop Sarkar <asiamgenius at gmail.com> writes:

> 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
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 487 bytes
Desc: not available
URL: <http://mail.haskell.org/pipermail/ghc-devs/attachments/20180319/252a4ad9/attachment.sig>


More information about the ghc-devs mailing list