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

Tom Ellis tom-lists-haskell-cafe-2023 at jaguarpaw.co.uk
Wed Aug 23 11:11:23 UTC 2023


No, sorry, it's me who's missing something.  The subject line of my
email is correct, but the content was not.  What I wanted was a way of
writing

    forall (a :: k). Typeable a => Dict (Typeable k)

or, if you like

  forall (a :: k). Typeable a => TypeRep k

Given your suggestion I searched for usages of TypeRep in the
documentation and found that (something equivalent to) it already
exists:

   typeRepKind :: TypeRep (a :: k) -> TypeRep k 

https://www.stackage.org/haddock/lts-21.8/base-4.17.2.0/Type-Reflection.html#v:typeRepKind

So problem solved.  Thanks!

Tom

On Wed, Aug 23, 2023 at 01:58:16PM +0300, Oleg Grenrus wrote:
> I missing something?
> 
> On 23.8.2023 13.50, Tom Ellis wrote:
> > Morally I think that
> > 
> >      class Typeable (a :: k)
> > 
> > should have been
> > 
> >      class Typeable k => Typeable (a :: k)
> > 
> > If I'm wrong, could someone please elaborate why?  If I'm right,
> > please read on ...
> > 
> > That would be a breaking change, but could we at least get
> > 
> >      kindable :: forall (a :: k). Typeable a => Dict (Typable (a :: k))
> > 
> > in the meantime?


More information about the Haskell-Cafe mailing list