Export the Fingerprint type from public modules
Needs RevisionPublic

Authored by dfeuer on May 23 2017, 1:43 AM.



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.

dfeuer created this revision.May 23 2017, 1:43 AM
bgamari edited edge metadata.May 23 2017, 8:29 AM

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 believe we decided against acting on this, right?

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

bgamari requested changes to this revision.Jun 5 2017, 10:27 AM

Alright. Requesting changes until that happens.

This revision now requires changes to proceed.Jun 5 2017, 10:27 AM
austin resigned from this revision.Nov 9 2017, 11:38 AM
austin requested changes to this revision.
austin resigned from this revision.Nov 9 2017, 5:35 PM