I have a function of the effect:
f :: a -> Either b c
I want to build a conduit of this type:
ConduitT a c m (Maybe b)
Basically, we've got a stream of as, and I want produce a stream of cs, but fail fast on error b.
If I was using lists, I'd be basically making a function
[a] -> Either b [c]
Which would be easy, just sequence . (map f).
But I'm having trouble converting this to conduits. Any ideas?