Unnamed type parameters

120 views
Skip to first unread message

Rich Oliver

unread,
Mar 6, 2016, 11:54:21 AM3/6/16
to dotty-internals
From HigherKinded-v2.md

The core idea: A parameterized class such as

class Map[K, V]
 

is treated as equivalent to a type with type members:


class Map { type Map$K; type Map$V }

Is there any need to be able to declare type members without a name? It seems to me that the principle should be to minimise ceremony,
facilitate brevity for the consumer, but this should not be a priority higher up the producer chain. Scala's case class's follow this principle.
It should always be easier to consume a class, trait or method than to create it. Anyway wouldn't it not only be simpler for the compiler,
but also better to enforce explicit names for type parameters creation. Meaningful names for value variable names is normally considered good practice,
why not the same for type variable names?


Reply all
Reply to author
Forward
0 new messages