ensure method

Decoder<A> ensure(
  1. Function1<A, bool> p,
  2. Function0<String> message
)

Implementation

Decoder<A> ensure(Function1<A, bool> p, Function0<String> message) =>
    Decoder.instance((c) => decodeC(c)
        .filterOrElse(p, () => DecodingFailure.fromString(message(), c)));