Top all-time · #23140
Mislav Javor
Personal blog · mislavjavor.github.ioprogrammingeconomics
Mislav Javor's personal blog at mislavjavor.github.io covers programming and economics. Since 2017, 3 different Hacker News readers have linked it 5 times, most often “Swift Enums Are “sum” Types. That Makes Them Very Interesting”. The last post was in 2018, but the archive is still widely read.
Too few sampled comments (1) to say how often HN recommends it.?
Why HN links it
HN readers link this post explaining that Swift enums are algebraic sum types. One commenter calls it a great read while recommending a Result enum over closure-based callbacks in view controllers.
Summarised by Claude from a sample of 1 HN comments that link here. Each comment is marked recommending, critical or neutral (citing without judging); how this works.
Most-linked posts?
- Swift Enums Are “sum” Types. That Makes Them Very Interesting2 people · 2 mentions · first linked 2017-04-19
What Hacker News says?
This is a pattern that I've started using everywhere and it's incredibly useful. The common closure format of: (T?, Error?) -> () means you have possibly four different options for the return value, it's much simpler to represent as: enum Result<T> { case success(T) case error(Error) } Here's a great read about how Swift enums are algebraic sum types: https://mislavjavor.github.io/2017-04-19/Swift-enums-are-sum...
Comment linking /2017-04-19/Swift-enums-are-sum-types.-That-makes-them-very-interesting/
on “Maintaining State in Your ViewControllers – Swift”Submitted 6 Reasons Why F# Might Be the Coolest Language You've Never Heard Of as a story · 5 points
HN discussionSubmitted Swift Enums Are “sum” Types. That Makes Them Very Interesting as a story · 2 points
HN discussionSubmitted Types of Blockchain Tokens and a Case Against Utility Tokens as a story · 1 points
HN discussionSubmitted Swift enums are “Sum” types. That makes them very interesting as a story · 1 points
HN discussion