Changes between Version 14 and Version 15 of Annotations


Ignore:
Timestamp:
May 6, 2009 9:26:46 PM (6 years ago)
Author:
batterseapower
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • Annotations

    v14 v15  
    1515== State Of Play == 
    1616 
    17 An annotations system was implemented as part of the Compiler Plugins Summer of Code project (Summer 08). It is currently in the process of being revised before being committed to GHC HEAD. Details of the implementation are below. 
     17An annotations system was implemented as part of the Compiler Plugins Summer of Code project (Summer 08). It has been submitted to the HEAD, and will appear in GHC 6.12 and later.  Documentation will be available at http://www.haskell.org/ghc/docs/latest/html/users_guide/pragmas.html when that is released. 
     18 
     19The situation as-implemented is not well represented by the text below. The annotation system committed in the end is very simple. Basically, you can write things like this: 
     20 
     21{-# ANN x e #-} 
     22 
     23Where x is an identifier and e is an expression with a Data instance (used only for serialization - a bit of a wart). You can also annotate types and modules in the same manner: 
     24 
     25{-# ANN type T e #-} 
     26{-# ANN module e #-} 
     27 
     28The expressions e are all evaluated at compile time, and subject to the same restrictions as spliced expressions in Template Haskell. 
     29 
     30Annotations are accessible via the GHC API by doing something such as this (untested): 
     31 
     32{{{ 
     33import Serialized 
     34import Annotations 
     35import GHC 
     36 
     37findAnnsForNamedThing nm = findGlobalAnns deserializeWithData (NamedTarget nm) 
     38}}} 
     39 
    1840 
    1941== Summer of Code Implementation (OLD) ==