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 the with construct? (or just map after the Either.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 on either)?
@paolosimone @neslinesli93 @cottinisimone
PR #29 highlighted how there's a set of functions from Scala\Haskell that we haven't considered. In particular
Try.mapfrom Scala acts as a functor onTryobjects, applying a function in case no exception was thrown.Currently we have
Either.trywhich maps a function application to an either, i.e.,:okif the function succeeded,:errorif an exception was thrown.A few questions from the top of my head:
Try.mapwhen the user could use thewithconstruct? (or justmapafter theEither.try)Either.trythat we could implement?Tryas a separate module (i.e. not piggybacking oneither)?@paolosimone @neslinesli93 @cottinisimone