Both Data.Typeable and Type.Reflection export functions that
produce Fingerprints, but neither of them exported the
Fingerprint type. Export it from both. This allows users to
give functions handling fingerprints type signatures without
importing a GHC-internal module.
Details
Diff Detail
- Repository
- rGHC Glasgow Haskell Compiler
- Branch
- export-fingerprint
- Lint
Lint OK - Unit
No Unit Test Coverage - Build Status
Really, I'm not sure we want to really make fingerprints part of Typeable's API. I consider them to be more of an implementation detail which cunning library authors can sometimes exploit, not something to be relied upon for every day use.
I'm very much opposed to exporting functions producing a type the user
can't see. I'd be okay with moving *all* the fingerprint exports, including
those functions, to a separate public fingerprint module. Or even hiding
them all away. But this half-way approach is troubling.
Actually, you've already baked Fingerprint into the interface to a
substantial degree by your choice of Ord instance. To keep fingerprints
private, TypeReps should be ordered based on their structures, along with
module and constructor names. So I think if you're going to have that
instance, you might as well have the type that underlies it.
I think for now, yes, but also decided to remove fingerprint-related
exports from Type.Reflection. So I guess I can put the latter together
today.