Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Option is implemented only by the two case classes Some and None. All case classes implement Product automatically. Having Option extend Product allows access to these methods from variables with the static type Option.

I'm having a hard time thinking of a use for the Product interface to Option, but I suppose it might as well be allowed since it is implemented anyway.



Consider applying for YC's Fall 2026 batch! Applications are open till July 27.

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: