Changes between Version 8 and Version 9 of GhcKinds/PolyTypeable


Ignore:
Timestamp:
Jun 6, 2013 7:40:28 AM (2 years ago)
Author:
dreixel
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • GhcKinds/PolyTypeable

    v8 v9  
    3333
    3434class Typeable t where
    35   typeRep :: Proxy t -> TypeRep
     35  typeRep :: proxy t -> TypeRep
    3636}}}
    3737Notice that
    38  * `Typeable` and `Proxy` have polymorphic kinds:
     38 * `Typeable` has a polymorphic kind:
    3939{{{
    40   Proxy    :: forall k. k -> *
    4140  Typeable :: forall k. k -> Constraint
    4241}}}
     
    4443 * The method is called `typeRep` rather than `typeOf`
    4544
    46  * One reason for the name change is that the argument is not a value of the type `t`, but a value of type `(Proxy t)`.  We have to do this because `t` may have any kind, so we can't say
     45 * One reason for the name change is that the argument is not a value of the type `t`, but a value of type `(proxy t)`.  We have to do this because `t` may have any kind, so we can't say
    4746{{{
    4847  typeOf :: t -> TypeRep
     48}}}
     49
     50 * You can instantiate `proxy` to whatever you want; one common choice is the poly-kinded `Proxy` datatype:
     51{{{
     52  Proxy:: forall k. k -> *
    4953}}}
    5054