By: Matt Barackman
A collection of objects or case classes that share a sealed trait.
In the example below, the type family would be a collection of traffic light colors with Red
, Yellow
, and Green
as member objects.
By: Matt Barackman
A collection of objects or case classes that share a sealed trait.
In the example below, the type family would be a collection of traffic light colors with Red
, Yellow
, and Green
as member objects.
Kris Nuttycombe asks:
I genuinely wish I understood the appeal of unityped languages better. Can someone who really knows both well-typed and unityped explain?
I think the terms well-typed and unityped are a bit of question-begging here (you might as well say good-typed versus bad-typed), so instead I will say statically-typed and dynamically-typed.
I'm going to approach this article using Scala to stand-in for static typing and Python for dynamic typing. I feel like I am credibly proficient both languages: I don't currently write a lot of Python, but I still have affection for the language, and have probably written hundreds of thousands of lines of Python code over the years.