logoalt Hacker News

bts01/21/20252 repliesview on HN

And functional programmers would argue that contravariance is the real meaning of Liskov’s substitution principle: https://apocalisp.wordpress.com/2010/10/06/liskov-substituti...


Replies

gsf_emergency01/22/2025

>So LSP just says “predicates are contravariant”

Maybe just leave out the "just" for a pleasant journey?

Since the interesting part of Barbara's uh, guideline, as "almost" pointed out by your link, is "almost" the opposite of "almost" trivial..

Don't mind me, I'm imbecilic :)

(See your link's comments, at least those imbeciles "almost" get it)

zbyforgotp01/22/2025

A practical rephrasing of LSP: subclasses should be subtypes.