Changes between Version 12 and Version 13 of CrossPackageDocumentation

Show
Ignore:
Timestamp:
05/28/09 09:50:28 (6 years ago)
Author:
simonmar (IP: 213.199.128.148)
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • CrossPackageDocumentation

    v12 v13  
    2525We might not need to store anything in the .haddock files if we can reconstruct all declarations from the `TyThings` available in the .hi files. We already convert instances using a conversion function `toHsType :: Type -> HsType Name`. We could try to write a conversation function `toHsDecl :: TyThing -> HsDecl Name`. 
    2626 
    27 Apparently, it might also be possible to do the conversion using existing Template Haskell functionality. This needs looking into. 
     27It might also be possible to do the conversion using existing Template Haskell functionality in GHC.  Template Haskell lets you `reify` an identify, which returns the abstract syntax of its declaration (or type).  Internally to GHC, the implementation of `reify` turns a `TyThing` into a `TH.Dec`.  There is also functionality in Template Haskell that turns `TH.Dec` into `HsSyn`, for compilation by GHC (see `hsSyn/Convert.lhs`).  Hence, in theory we have all the bits to get from `TyThing` to `HsSyn` already in GHC, we just have to connect them up. 
    2828 
    2929The downside of this approach is that we lose the original declaration style. For example, we don't know if a data type was declared using GADT-style syntax (with a 'where' clause), or normal style. Other examples: