Fantastic, clear explanation, with good examples and motivation. @rae, could you please make a follow-up video explaining type roles (nominal, representational, and phantom), and how they fit into deriving?
`T` and `Age` really doesn't have any formal relation at all. You can't coerce from one to the other since they have different runtime representations and their instances are completely different. I don't think they would be in a subtype relation even in an OOP language. Age might have been a subtype of Int in an OOP language, but that is still not the case here, since their instances are independent of each other. We could even use deriving via to copy instances in the reverse direction: *from* Age *to* Int.
This is a great video. I like the pacing, and how focused it is (no switching of windows or tabs). Thank you!
Great pacing, great delivery. Learned a lot - now wandering off to watch your other videos!
Fantastic, clear explanation, with good examples and motivation.
@rae, could you please make a follow-up video explaining type roles (nominal, representational, and phantom), and how they fit into deriving?
I guess the video “Roles can break abstraction” covers that?
Thank you, this was very helpful
Isn't this type wrapper mkage just a sub-type of mkt?
`T` and `Age` really doesn't have any formal relation at all. You can't coerce from one to the other since they have different runtime representations and their instances are completely different. I don't think they would be in a subtype relation even in an OOP language.
Age might have been a subtype of Int in an OOP language, but that is still not the case here, since their instances are independent of each other. We could even use deriving via to copy instances in the reverse direction: *from* Age *to* Int.