Re:Algebraic Data Types for C99
by j2kun on Thursday May 09, 2024 @12:38PM
(#40310000)
Your examples, on the TIOBE index, are #4, #18, and #28. https://www.tiobe.com/tiobe-index/
[ Parent
| on HN ]
Re:Algebraic Data Types for C99
by CraigJPerry on Thursday May 09, 2024 @05:26PM
(#40313131)
Product types are one kind of algebraic data type, only 5 languages from that TIOBE page don’t have them so most common langs have ADTs
When you have natural numbers and a multiplication operation (product) would you say that those form an algebra? (ADT means algebraic data type)
Re:Algebraic Data Types for C99
by CraigJPerry on Friday May 10, 2024 @02:45AM
(#40316050)
You’ve got both a carrier (the set of natural numbers) and a morphism (product operation) so yeah you have an algebra.