
#9123: Need for higher kinded roles -------------------------------------+------------------------------------ Reporter: simonpj | Owner: Type: bug | 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 nomeata):
If we do allow users to write their own instances, we seem to lose the guarantee that coerce is free at runtime, no?
Did anyone say guarantee? It’s a promise, not more :-) What I’m saying: By passing around boxed `Coercible` witnesses (e.g. in the `Coercion` data type) you can probably create quite complex terms that the compiler will not be able to simplify completely. Then `coerce` still incurs the cost of evaluating that box. So I would not worry that a ill- meaning user can make `coerce` expensive by writing strange `Representational` instances, as long as he can write good instances where there are good instances. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/9123#comment:8 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler