Shapes vs. Materials

Mark "Justin" Waks
1 min readMay 22, 2020

--

A quick pointer for the folks paying attention to the deep details of possible Scala 3: Martin just opened this interesting issue, discussing some possible tweaks to type inference to make it a bit cleaner.

I recommend reading the ticket for more detail, but the tl;dr is that some traits (eg, Product or Serializable) tend to mess up type inference for the classes that inherit from them. The notion at hand is, instead of trying to fix those in an ad-hoc way, introduce a new concept of “shape” traits that are handled slightly differently, and language support to define such traits formally.

This is just an idea at this point — not even working code, much less a proposal for Scala 3. But it’s worth reading, and commenting on if you have thoughts.

--

--

Mark "Justin" Waks
Mark "Justin" Waks

Written by Mark "Justin" Waks

Lifelong programmer and software architect, specializing in online social tools and (nowadays) Scala. Architect of Querki (“leading the small data revolution”).

No responses yet