[GHC] #14190: Typeable imposes seemingly redundant constraints on polykinded instances
GHC
ghc-devs at haskell.org
Thu Sep 7 13:00:07 UTC 2017
#14190: Typeable imposes seemingly redundant constraints on polykinded instances
-------------------------------------+-------------------------------------
Reporter: dfeuer | Owner: (none)
Type: bug | Status: new
Priority: normal | Milestone: 8.4.1
Component: Compiler (Type | Version: 8.2.1
checker) | Keywords:
Resolution: | TypeableReflection
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 RyanGlScott):
The reason you need a `Typeable k` constraint is quite simple: `k` is just
as much of a type as `a` or `b`, so in order to obtain a proper `TypeRep`
for `Const`, you need to also obtain the `TypeRep`s for `a`, `b`, and `k`,
requiring them all to be `Typeable` instances:
{{{
λ> typeRep :: TypeRep (Const String Type)
Const * [Char] *
λ> typeRep :: TypeRep (Const String (Nothing :: Maybe Bool))
Const (Maybe Bool) [Char] ('Nothing Bool)
}}}
I don't see a bug here.
--
Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/14190#comment:2>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler
More information about the ghc-tickets
mailing list