Is it possible to write a decoder for a NonEmptyList in a generic manner? The only way I've managed to do it is defining an encoder per type. Say I have NonEmptyLists of NonNegSeconds and NonNegDouble. Do I need to define an encoder for each or is there a way to do it with type parameters if I have decoders for NonNegDouble and NonNegSeconds in the scope already?
Hello,
Is it possible to write a decoder for a
NonEmptyList
in a generic manner? The only way I've managed to do it is defining an encoder per type. Say I haveNonEmptyList
s ofNonNegSeconds
andNonNegDouble
. Do I need to define an encoder for each or is there a way to do it with type parameters if I have decoders forNonNegDouble
andNonNegSeconds
in the scope already?Thanks!