... | ... | @@ -5,6 +5,34 @@ This is Ben Gamari's plan for moving ahead with the type-indexed `Typeable` |
|
|
scheme, described most recently in
|
|
|
[ A reflection on types](http://research.microsoft.com/en-us/um/people/simonpj/papers/haskell-dynamic/).
|
|
|
|
|
|
## Status
|
|
|
|
|
|
|
|
|
A branch with the current state of things can be found [ here](https://github.com/ghc/ghc/compare/master...bgamari:wip/ttypeable). There is also an intermittently-updated Phabricator differential, [ Phab:D2010](https://phabricator.haskell.org/D2010). It's still rather preliminary however it does give you a working stage2 compiler with functional type-indexed type representations and what I believe is a pretty reasonable set of interfaces, described below.
|
|
|
|
|
|
|
|
|
There are a number of tasks outstanding. These involve only Ben,
|
|
|
|
|
|
- Fix representation pretty-printer to correctly handle tuples, lists, arrows, and precedence
|
|
|
- Examine performance changes (even some improvements, perplexingly)
|
|
|
- Look at testsuite failures involving stack overflows: `T10294, plugins01, T5550, annrun01, ann01, annth_make`
|
|
|
- Evaluate whether we want to try harder to preserve the re-exports that have been dropped from `Data.Dynamic`.
|
|
|
- Some of the new naming choices should be revisited (e.g. `TRFun`)
|
|
|
- Typeable fingerprints need to be made more robust ([\#7897](https://gitlab.haskell.org//ghc/ghc/issues/7897))
|
|
|
- Performance:
|
|
|
|
|
|
- Carefully check `Data.Typeable` for deviations from the previous interface and fill in gaps where possible
|
|
|
- Examine whether the primitive `TypeRep`s (e.g. `trTYPE`, `trArrow`) should be `INLINEABLE`; we perform a number of runtime checks during serialization/deserialization so being able to inline these fingerprints may be helpful.
|
|
|
- Perhaps generated `TyCon`s should also be inlined (or generate rules to inline just fingerprints)
|
|
|
- Perhaps it would be worth offering unsafe deserialization interface without runtime checks?
|
|
|
|
|
|
|
|
|
These are issues that need to be addressed elsewhere in the compiler,
|
|
|
|
|
|
- [\#11736](https://gitlab.haskell.org//ghc/ghc/issues/11736): Core Lint rejects unsaturated applications of unlifted types; it's not clear whether this is actually a safe thing to do
|
|
|
- [\#11714](https://gitlab.haskell.org//ghc/ghc/issues/11714): kind of `(->)` is overly-restrictive consequently `T11120` testcase fails
|
|
|
- [\#11715](https://gitlab.haskell.org//ghc/ghc/issues/11715): `TypeOf` fails due to the fact that `Constraint` and `*` are indistinguishable in Core
|
|
|
|
|
|
## `Type.Reflection`
|
|
|
|
|
|
|
... | ... | |