Changes to Typeable

Edward Kmett ekmett at
Mon Feb 13 19:16:37 CET 2012

You could probably get away with something like

data Proxy = Proxy a

class Typeable a where
  typeOfProxy :: Proxy a -> TypeRep

typeOf :: forall a. Typeable a => a -> TypeRep
typeOf = typeOfProxy (Proxy :: Proxy a)

which being outside of the class won't contribute to the inference of 'a's

This would let you retain the existing functionality.

On Mon, Feb 13, 2012 at 8:33 AM, Simon Marlow <marlowsd at> wrote:

> On 10/02/2012 16:03, Simon Peyton-Jones wrote:
>> Friends
>> The page describes an improved implementation of the Typeable class,
>> making use of polymorphic kinds. Technically it is straightforward, but it
>> represents a non-backward-compatible change to a widely used library, so we
>> need to make a plan for the transition.
>> Comments?  You can fix typos or add issues directly in the wiki page, or
>> discuss by email
> I've no objections to the plan itself, except that typeOf itself seems
> useful, so is there any need to deprecate it?
> Cheers,
>        Simon
> ______________________________**_________________
> Glasgow-haskell-users mailing list
> Glasgow-haskell-users at haskell.**org <Glasgow-haskell-users at>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <>

More information about the Glasgow-haskell-users mailing list