Ensure method signatures are minimal
Requirements by @987Nabil
We need to ensure, that method signatures are minimal. Meaning not only minimal in the amount of params but in the power the handed over params can do. One such example you see below in the original text of the issue.
Original
Is your feature request related to a problem? Please describe.
The method Body.to[A] currently requires a BinaryCodec[A] instance, though it only performs decoding operations. This creates unnecessary constraints as users must implement a full codec even when only decoding functionality is needed.
Describe the solution you'd like
I suggest changing the method signature to use BinaryDecoder[A] instead:
def to[A](implicit decoder: BinaryDecoder[A], trace: Trace): Task[A]
Describe alternatives you've considered Keeping the current implementation if there are backward compatibility concerns
Additional context
Similar consideration might apply to encoding methods (from, fromStream, fromStreamEnv) which currently require BinaryCodec but only use encoding functionality.
This can't be done in a binary compatible way. In 4.0 this structure will change anyway. I will keep this issue open for tracking and ensuring APIs a minimal in requirements to preform their functionality.