noether
noether copied to clipboard
Try.* functions
PR #29 highlighted how there's a set of functions from Scala\Haskell that we haven't considered. In particular Try.map
from Scala acts as a functor on Try
objects, applying a function in case no exception was thrown.
Currently we have Either.try
which maps a function application to an either, i.e., :ok
if the function succeeded, :error
if an exception was thrown.
A few questions from the top of my head:
- do we need
Try.map
when the user could use thewith
construct? (or justmap
after theEither.try
) - are there other functions outside of
Either.try
that we could implement? - would it make sense to treat
Try
as a separate module (i.e. not piggybacking oneither
)?
@paolosimone @neslinesli93 @cottinisimone