
Would universally deriving `Typeable` break some abstraction guarantees? That is, if a library wanted to hide some types, could they be gotten
#9111: base should export Typeable instances of its promoted data constructors -------------------------------------+------------------------------------ Reporter: goldfire | Owner: Type: feature request | Status: new Priority: normal | Milestone: Component: Compiler | Version: 7.8.2 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: Unknown/Multiple Type of failure: None/Unknown | Difficulty: Unknown Test Case: | Blocked By: Blocking: | Related Tickets: -------------------------------------+------------------------------------ Comment (by dreixel): Replying to [comment:11 goldfire]: through their (unhideable) `Typeable` instances? Template Haskell can surely do this, but I might be willing to ignore that particular attack. Are there others? What if a type is known but not the constructors? (I don't think `Typeable` can do this.) What about if a type synonym is known but the RHS isn't exported? (I bet it can do this.) `Typeable` knows nothing about the RHS of its type, so constructors are safe. Also, if you don't export a type nor any of its constructors, I don't see how you could use its |typeRep|, so I guess you're safe too (ignoring Template Haskell, of course). -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/9111#comment:12 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler