Yes, it's entirely unproblematic, and a good suggestion.<br><br><br>Thanks,<br>Pedro<br><br><div class="gmail_quote">On Sat, Jan 26, 2013 at 6:36 PM, Simon Peyton-Jones <span dir="ltr"><<a href="mailto:simonpj@microsoft.com" target="_blank">simonpj@microsoft.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Good idea! Simple, and I see no downsides.<br>
<br>
Pedro is putting in place a new Typeable library (using kind polymorphism) for GHC 7.8. Pedro, might you incorporate this?<br>
<span class="HOEnZb"><font color="#888888"><br>
Simon<br>
</font></span><div class="HOEnZb"><div class="h5"><br>
| -----Original Message-----<br>
| From: <a href="mailto:libraries-bounces@haskell.org">libraries-bounces@haskell.org</a> [mailto:<a href="mailto:libraries-bounces@haskell.org">libraries-bounces@haskell.org</a>] On<br>
| Behalf Of Shachaf Ben-Kiki<br>
| Sent: 26 January 2013 04:07<br>
| To: <a href="mailto:libraries@haskell.org">libraries@haskell.org</a><br>
| Subject: Proxy and new-typeable<br>
|<br>
| I see that the new-typeable branch in GHC is using "typeRep :: forall a.<br>
| Typeable a => Proxy a -> TypeRep" rather than "typeOf :: forall a. Typeable a<br>
| => a -> TypeRep". This is clearly a big improvement over using undefined<br>
| everywhere.<br>
|<br>
| I'd like to suggest a small change, if it hasn't been brought up before --<br>
| "typeRep :: forall proxy a. Typeable a => proxy a -> TypeRep". This makes<br>
| typeRep compatible with any other Proxy type, since it doesn't use any<br>
| properties of the concrete type -- it just uses it to pass information about<br>
| the "a". Things that consume a Proxy don't ever need to refer to Proxy<br>
| explicitly.<br>
|<br>
| This would make Typeable compatible with other Proxy libraries, like the one in<br>
| "tagged". It would also make it compatible with any other type of kind * -> *<br>
| -- for example, "typeRep ([] :: [Int])" would be a valid, and arguable more<br>
| convenient, syntax for using typeRep. "Nothing :: Maybe Int" and so on would<br>
| work too. So things that produce a "proxy" don't need to refer to Proxy<br>
| explicitly either.<br>
|<br>
| Possibly this would make the Proxy type entirely unnecessary. If it stays,<br>
| though, I suggest that it belongs in a module other than Data.Typeable.Internal<br>
| -- it's a useful type for many other things, and as long as it's in base and<br>
| exposed to users, it might as well be treated as a type in its own right. It's<br>
| also a monad, can provide a variant of `asTypeOf`, and so on.<br>
|<br>
| Shachaf<br>
|<br>
| _______________________________________________<br>
| Libraries mailing list<br>
| <a href="mailto:Libraries@haskell.org">Libraries@haskell.org</a><br>
| <a href="http://www.haskell.org/mailman/listinfo/libraries" target="_blank">http://www.haskell.org/mailman/listinfo/libraries</a><br>
</div></div></blockquote></div><br>