Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do the new Scala TypeTags improve the (deprecated) Manifests? [duplicate]

Possible Duplicate:
Scala 2.10: What is a TypeTag and how do I use it?

I have been reading about the new TypeTags which come along with the new reflection api. It seems that Manifests are supposed to be replaced with that new concept. Can anyone post some code examples to show the benefits?

Some references:

  • TypeTags API
  • SIP: Self-cleaning macros
  • Metaprogramming in Scala
like image 343
jeslg Avatar asked May 09 '12 09:05

jeslg


1 Answers

Manifests are a lie. It has no knowledge of variance (assumes all type parameters are co-variants), and it has no support for path-dependent, existential or structural types.

TypeTags are types as the compiler understands them. Not "like" the compiler understands them, but "as" the compiler understands them -- the compiler itself use TypeTags. It's not 1-to-1, it's just 1. :-)

like image 99
Daniel C. Sobral Avatar answered Nov 14 '22 22:11

Daniel C. Sobral