[GHC] #9123: Need for higher kinded roles
GHC
ghc-devs at haskell.org
Wed Jan 31 23:12:19 UTC 2018
#9123: Need for higher kinded roles
-------------------------------------+-------------------------------------
Reporter: simonpj | Owner: goldfire
Type: bug | Status: new
Priority: normal | Milestone:
Component: Compiler (Type | Version: 7.8.2
checker) | Keywords: Roles,
Resolution: | QuantifiedConstraints
Operating System: Unknown/Multiple | Architecture:
| Unknown/Multiple
Type of failure: None/Unknown | Test Case:
Blocked By: | Blocking:
Related Tickets: | Differential Rev(s):
Wiki Page: |
-------------------------------------+-------------------------------------
Comment (by simonpj):
I think Coercible is a special case because `Coercible p q` and `p ~R# q`
really are inter-convertible. Not so for `Eq a` and `Ord a`. And there
might be many classes that happen to have `Eq a` (perhaps distantly
transitively) as a superclass. Are we really going to search for a
solution via all of those? Now we are into backtracking.
It can go wrong with `~R#` too. Suppose we said
{{{
class (a ~R# b) => C a b where
op :: a -> b
}}}
Now if we want `t1 ~R# t2`, one route might be by seeking `C t1 t2`.
This way lies madness.
I could live with a special case for `Corecible`/`~R#` and `~`/`~N#`. But
the general case looks swampy.
--
Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/9123#comment:44>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler
More information about the ghc-tickets
mailing list