/// <summary> /// Map the input of the decoder. /// </summary> public static Decoder <TRaw2, T> Contramap <TRaw1, T, TRaw2>( this Decoder <TRaw1, T> decoder, [NotNull] Func <TRaw2, TRaw1> f) { return(decoder.Dimap(f, x => x)); }
/// <summary> /// Map the output of the decoder. /// </summary> public static Decoder <TRaw, T2> Map <TRaw, T1, T2>( this Decoder <TRaw, T1> decoder, [NotNull] Func <T1, T2> f) { return(decoder.Dimap <TRaw, T1, TRaw, T2>(x => x, f)); }