Hacker News new | ask | show | jobs
by Defletter 9 days ago
Huh, I didn't know how much I needed a "todo" type until now. So often I'll be defining a packet sumtype, or a collection, and not have created the type yet, so just use ubyte, or Object, or whatever. Having an explicit "todo" type would be amazing in other languages.
2 comments

Scala has had a function called ??? which fills the same role and it’s really useful.

https://scala-lang.org/api/3.3.1/scala/Predef$.html#???-0

Rust has the todo!() macro but no todo type. I use todo! constantly and would probably make heavy use of a todo type as well...
Todo type in rust will be a never type. Eg thing which exit or panic returns
Oh I hadn't thought about that!