Re: [Haskell-cafe] Can I get 'forall (a :: k). Typeable a => Dict (Typeable k)'?

To respond to your original point:
Morally I think that
class Typeable (a :: k)
should have been
class Typeable k => Typeable (a :: k)
This has been considered before, although it is not entirely straightforward to implement. See [1] and [2], which track the idea of having GHC solve these constraints automatically, without the need for users to explicitly reach for `typeRepKind`.
Best, Ryan ----- [1] https://gitlab.haskell.org/ghc/ghc/-/issues/14190 [2] https://gitlab.haskell.org/ghc/ghc/-/issues/16627

On Wed, Aug 23, 2023 at 09:35:59AM -0400, Ryan Scott wrote:
Morally I think that
class Typeable (a :: k)
should have been
class Typeable k => Typeable (a :: k)
This has been considered before, although it is not entirely straightforward to implement. See [1] and [2], which track the idea of having GHC solve these constraints automatically, without the need for users to explicitly reach for `typeRepKind`.
[1] https://gitlab.haskell.org/ghc/ghc/-/issues/14190 [2] https://gitlab.haskell.org/ghc/ghc/-/issues/16627
Interesting reading. Thanks Ryan!
participants (2)
-
Ryan Scott
-
Tom Ellis