Hacker News new | ask | show | jobs
by kmicklas 3166 days ago
> Anyone is perfectly capable of implementing a Maybe/Option/whatever type in C

C doesn't even have parametric polymorphism, I'm not sure how you're imagining this can be done.

1 comments

Parametric polymorphism is needed to implement “Maybe” as a generic type that can be applied to another type, but you can implement individual concrete Maybe X types without it.

You could possibly use macro programming to do it “generically” at a level outside the type system.