Interesting, never thought about returning Option for a "constructor" instead of throwing.
It makes perfect sense, but I was too used to throwing being the default option in real (new keyword) constructors that I extended that to everything, even primitives wrapped in newtypes.
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
Interesting, never thought about returning
Option
for a "constructor" instead of throwing.It makes perfect sense, but I was too used to throwing being the default option in real (
new
keyword) constructors that I extended that to everything, even primitives wrapped in newtypes.