Open andyscott opened 7 years ago
It would be useful to be able to create decoders directly from A => Try[B]. The error can be directly turned into the underlying error wrapper.
A => Try[B]
For example, for monix-kafka:
monix-kafka
implicit val decodeKafkaProducerConfig: ConfigDecoder[KafkaProducerConfig] = Decoder.instance(c => Try(KafkaProducerConfig(c)).toEither.leftMap(DecodeError.Underlying(_)))
this ideally could just be written as:
implicit val decodeKafkaProducerConfig: ConfigDecoder[KafkaProducerConfig] = Decoder.instance(c => Try(KafkaProducerConfig(c)))
It would be useful to be able to create decoders directly from
A => Try[B]
. The error can be directly turned into the underlying error wrapper.For example, for
monix-kafka
:this ideally could just be written as: