HORIZON HASKELLDocslts/ghc-10.0.xfc4e5982026-10-11Search names, modules, packages, or :: a typeCtrl K

GHC 10.0.0.20260917 · lts/ghc-10.0.x · fc4e598 · 2026-10-11

Moduleghc-lib-parser-9.14.1.20251220GHC2021

GHC.Types.Annotations

Support for source code annotation feature of GHC. That is the ANN pragma.

(c) The University of Glasgow 2006 (c) The GRASP/AQUA Project, Glasgow University, 1992-1998

  • 5 types
  • 7 values

Main Annotation data types

4 declarations
datadata AnnTarget name
#

An annotation target

Constructors

Instances4Functor, NFData, Outputable, Binary

AnnEnv for collecting and querying Annotations

8 declarations
datadata AnnEnv
#

A collection of annotations

valuemkAnnEnv :: [Annotation] -> AnnEnv
#

Construct a new annotation environment that contains the list of annotations provided.

valuefindAnns :: Typeable a => ([Word8] -> a) -> AnnEnv -> CoreAnnTarget -> [a]
#

Find the annotations attached to the given target as Typeable values of your choice. If no deserializer is specified, only transient annotations will be returned.

valuedeserializeAnns
  1. :: Typeable a
  2. => [Word8] -> a
  3. -> AnnEnv
  4. -> (ModuleEnv [a], NameEnv [a])
#

Deserialize all annotations of a given type. This happens lazily, that is no deserialization will take place until the [a] is actually demanded and the [a] can also be empty (the UniqFM is not filtered).