Great article, here's the first in the series: <a href="https://miklos-martin.github.io/learn/fp/category-theory/2018/01/29/adventures-in-category-theory-introduction.html" rel="nofollow">https://miklos-martin.github.io/learn/fp/category-theory/201...</a>
> If our objects are sets (as they are in the category of types and functions)<p>And from the previous article:<p>> What I do love about category theory is that it is not some framework, or design pattern, or best practice that somebody came up with empirically because it helped them solve their problem, but it has strong mathematical foundations. It always adds up, things click smoothly, and it is just so satisfying and fun to experience this.<p>I was thinking about that in the context of nominal and structural typing. From my (limited) understanding, set theory is equivalent to structural typing. That would mean the following:<p><pre><code> type point = { x: int; y: int }
type my_point = { x: int; y: int }
let example (p: point) = p.x + p.y
let po: point = { x = 5; y = 6 }
let my_po: my_point = { x = 1; y = 2 }
example po // => 11
example my_po // => type error
</code></pre>
should typecheck, as point and my_point are exactly the same from a "set" point of view. But they don't. It's like naming the record made them different types even if they are structurally the same. So this is something I don't understand. I feel like I'm missing something, but I don't know what.