News for hackers. Stuff that matters.
Re:Algebraic Data Types for C99 by brabel on Thursday May 09, 2024 @02:25PM (#40311290)
This is trivial to model by making your type `T | null | Missing`.
Re:Algebraic Data Types for C99 by efnx on Thursday May 09, 2024 @03:29PM (#40312068)
Maybe trivial to “work around” but there is a difference, ay?

With this type you would have to check/match an extra case!

The type you use there also takes more memory than Option<T> or Maybe<T>. So it has some other downsides.

Re:Algebraic Data Types for C99 by epolanski on Thursday May 09, 2024 @03:30PM (#40312078)
Or just using Option since you would have Some<null> or None in that case.
Re:Algebraic Data Types for C99 by hexane360 on Friday May 10, 2024 @04:02PM (#40323252)
Only if you're designing both functions ahead of time. In other words, it's not composable.