An unofficial, read-only Hacker News reader. Join the beta →

The algebra of dependent types (2025) (opens external site)

113 points by todsacerdoti 4 days ago | dotat.at | 26 comments on HN

View full thread · View on Hacker News

Comment thread (1)

  1. You’re only right for lazy pairs, I think.

    In a strict language (or with a strict pair in a lazy language), you normally won’t be able to (integer) divide by zero while computing a value, then go on to ignore that, pack that erroneous value into a pair, and extract the other, valid value from it and go on with your life.

    Similarly, if your program has hung while computing one half of a pair then (except in lazy languages) it will have hung while computing the pair as a whole as well.

    (Haskell’s type algebra is indeed somewhat subtler.)