| 27 | | It 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. |
| | 27 | It might also be possible to do the conversion using existing Template Haskell functionality in GHC. Template Haskell lets you `reify` an identifier, 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. |