Suggestion for `try` functions
I propose we get rid of the try naming altogether and return valueoption by default. Existing throwing functions should have a prefix like unsafe instead: tryHead -> head, head -> tryHead >> Option.getOrThrow
I propose we get rid of the
trynaming altogether and return valueoption by default. Existing throwing functions should have a prefix likeunsafeinstead:tryHead->head,head->unsafeHead.
I want this library to be a drop-in replacement, meaning I intend to leave try functions in place.
We can change behaviour of normal ones too
We can still include the try prefix functions for back compat then. But we can add unsafe functions and have the unprefixed functions default to try instead.
We can still include the try prefix functions for back compat then. But we can add unsafe functions and have the unprefixed functions default to try instead.
Yeah, need to emit proper messages/obsolete/compiler warnings and have a doc, since won't be a drop-in replacement anymore (for non-try variant).
Also - rename Option.get to Option.getOrThrow