Every story and comment from the Hacker News API, in a layout borrowed from 2001.
A comment on The Python Paradox. Parent comment
For example, imagine the following in an imaginary version of Rust with union types:
#[derive(PartialEq)] struct Option<T> { value: T | (), } impl<T> Option<T> { fn some(value: T) -> Self { Self { value } } fn none() -> Self { Self { value: () } } fn is_none(&self) -> bool { match self.value { _: () => true, _: T => false, } } }
There are no comments on this comment yet.
For example, imagine the following in an imaginary version of Rust with union types:
What does `Option::some(()).is_none()` return? Is `Option::some(()) == Option::none()`?