I just had the epiphany that the Liskov Substitution Principle may be generalised to category theory as a statement about co- and contravariance.
A quick web search shows that @runarorama figured that out 10 years ago apocalisp.wordpress.com/2010…
5
16
69
Don’t know about category theory, but surely the co/contravariance connection has been known even longer than that? I seem to recall the first time I read about the terms they were explained using LSP
1
1
You're probably right.
FWIW, I increasingly feel disadvantaged by not having a formal CS education. I sometimes arrive at things like this from odd angles. I first read about LSP in one of @unclebobmartin's papers, and I don't recall if it discussed contravariance...
1
1
I seem to recall covariant return types being introduced to C++ sometime in the late 90s, but I don’t recall the exact sequence of when I learned about what :)
Sep 29, 2020 · 2:07 PM UTC

