45 | | == Summer of Code Implementation (OLD) == |

| 45 | == Why The Implementation Is The Way It Is == |

| 46 | |

| 47 | * The interface-file loader (part of the GHC library) can't deserialise because it doesn't have an appropriate deserialiser for every type -- a client of the GHC library might be using one unknown to GHC. That's why Serialized is a pair (TypeRep, [Word8]) |

| 48 | * Any particular client, such as SpecConstr, is interested in annotations of a particular type (let's say just one for now). That type, T, is known to the client, of course. |

| 49 | |

| 50 | So the client can take the AnnEnv: |

| 51 | {{{ |

| 52 | AnnEnv = NameEnv [Serialized] |

| 53 | }}} |

| 54 | |

| 55 | and convert it to: |

| 56 | {{{ |

| 57 | MyAnnEnv = NameEnv T |

| 58 | }}} |

| 59 | |

| 60 | That is, find all the Serializeds whose TypeRep matches T, and deserialise them. |

| 61 | |

| 62 | The general function is something like: |

| 63 | |

| 64 | {{{ |

| 65 | deserialiseAnnEnv :: Typeable t => ([Word8] -> t) -> AnnEnv -> NameEnv t |

| 66 | }}} |

| 67 | |

| 68 | This function could be in main/Annotations.lhs. |

| 69 | |

| 70 | == OLD Implementation Notes == |

| 71 | |

| 72 | ** |