GHC issueshttps://gitlab.haskell.org/ghc/ghc/-/issues2019-07-07T19:16:40Zhttps://gitlab.haskell.org/ghc/ghc/-/issues/839Generate documentation for built-in types and primitve operations2019-07-07T19:16:40ZSimon Peyton JonesGenerate documentation for built-in types and primitve operationsGHC has a bunch of primitive types, which are not definable in Haskell, such as
- Int\#, Float\#, Double\# etc
- ByteArray\#
- etc
They are defined in `TysPrim` but nowhere documented.
GHC also has a handful of built-in functions, tha...GHC has a bunch of primitive types, which are not definable in Haskell, such as
- Int\#, Float\#, Double\# etc
- ByteArray\#
- etc
They are defined in `TysPrim` but nowhere documented.
GHC also has a handful of built-in functions, that are
- Not primops
- Are not definable in Haskell
- But are definable in Core
- Are defined in the compiler itself, in basicTypes/MkId.lhs
- Come from the pseudo-module `GHC.Prim`, like primops and primitive types.
The examples I can think of are
- unsafeCoerce
- inline
- lazy
Currently they are documented in the [(HEAD) user manual](http://www.haskell.org/ghc/dist/current/docs/users_guide/special-ids.html).
However, **both the primitive types, and these built-in functions, are invisible to Haddock**, and hence do not appear in the online Haddock documentation. This is bad.
You might think that the same would be true of the primitive operations (primops). However, the primops are described by a text file `prelude/primops.txt.pp}}, and there's a preprocessor ({{{utils/genprimopcode`) that generates the base-package pseudo-module `GHC/Prim.hs` from the text file. This pseudo-module is not compiled; but it *is* given to Haddock, and that's how the primops appear in the Haddock docs.
So the task is to add a bit of extra markup syntax to `primops.txt.pp` so that it can describe these special built-in types and functions, and inject their type signatures and documentation into `GHC/Prim.hs`, so that Haddock can see it. Not a huge task.
Thanks to Neil Mitchell for pointing out the difficulty.6.6.1Ian Lynagh <igloo@earth.li>Ian Lynagh <igloo@earth.li>https://gitlab.haskell.org/ghc/ghc/-/issues/249-caf-all bugs2019-07-07T19:18:50ZSimon Marlow-caf-all bugs```
P.C.Callaghan [p.c.callaghan@durham.ac.uk] submitted
this bug:
I'm trying to use the -caf-all flag with ghc-6.02, in
conjunction with -O
(which means going via C...)
But in a few modules of a large program, the .hc files
contain d...```
P.C.Callaghan [p.c.callaghan@durham.ac.uk] submitted
this bug:
I'm trying to use the -caf-all flag with ghc-6.02, in
conjunction with -O
(which means going via C...)
But in a few modules of a large program, the .hc files
contain duplicate
definitions of "MODsat_CAF_cc_ccs" (where MOD = a
particular module)
I can't see an obvious pattern to the number of
duplications. All the
affected modules use MPCs heavily. It doesn't look like
the duplications
are 1-1 with the instance decls. It only happens on a
few modules out
of many which also use classes heavily.
NB I hand-patched the .hc files by hand, and in the
results, not much of
the dictionary/caf info showed up! Should -auto-dicts work?
```6.6.1Ian Lynagh <igloo@earth.li>Ian Lynagh <igloo@earth.li>