Suppose that I have a source keypads :: Producer IO Keypad
that produces a stream of sensitive data such as one-time keypads.
Now if my library exposes keypads
, an end-user might connect keypads
to two sinks, let's call them good
and bad
, where bad
requests a value and reads it, but then returns it back upstream via leftover
. Later on, the good
sink might consume the same keypad previously read by bad
. The enduser might be oblivious to this happening, for example if good
and bad
are provided by external libraries.
Is there any way to design a read-only source in conduit that discards leftover data?
(I've read here that it's not possible to disable reusing leftovers, but as I'm new to conduits, maybe there's a different way to design the architecture that I'm not seeing.)