Get the latest tech news
Show HN: Sum (algebraic) types for C in one 100 line header
A mirror of https://git.sr.ht/~grego/sumtypes.h. Contribute to grego/sumtype.h development by creating an account on GitHub.
Safe, intuitive sum types with exhaustive pattern matching in a single 100 line header, pure C99. If the value being matched is of this variant, the let macro generates a binding to a pointer to a value of this type with the provided name, which you may use in the following statement. It is a 100 line single header that you can just copy into your project and even quickly understand and modify to your liking.
Or read this on Hacker News